Use frexp from Rug

Rug 1.27.0 exposes `frexp`. Make use of it for our tests.
This commit is contained in:
Trevor Gross 2025-01-25 01:00:01 +00:00
parent 62f0fd40d1
commit edd1289341

View file

@ -310,13 +310,8 @@ macro_rules! impl_op_for_ty {
}
fn run(this: &mut Self::MpTy, input: Self::RustArgs) -> Self::RustRet {
// Implementation taken from `rug::Float::to_f32_exp`.
this.assign(input.0);
let exp = this.get_exp().unwrap_or(0);
if exp != 0 {
*this >>= exp;
}
let exp = this.frexp_mut();
(prep_retval::<Self::FTy>(this, Ordering::Equal), exp)
}
}