Skip to content

Commit a6ba249

Browse files
committed
Use frexp from Rug
Rug 1.27.0 exposes `frexp`. Make use of it for our tests.
1 parent bd2ea1c commit a6ba249

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

crates/libm-test/src/mpfloat.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,8 @@ macro_rules! impl_op_for_ty {
310310
}
311311

312312
fn run(this: &mut Self::MpTy, input: Self::RustArgs) -> Self::RustRet {
313-
// Implementation taken from `rug::Float::to_f32_exp`.
314313
this.assign(input.0);
315-
let exp = this.get_exp().unwrap_or(0);
316-
if exp != 0 {
317-
*this >>= exp;
318-
}
319-
314+
let exp = this.frexp_mut();
320315
(prep_retval::<Self::FTy>(this, Ordering::Equal), exp)
321316
}
322317
}

0 commit comments

Comments
 (0)