mp_integer: implement integral_cast.