mp_rational: implement integral_cast.