Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 5f3fdcd

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

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
@@ -319,13 +319,8 @@ macro_rules! impl_op_for_ty {
319319
}
320320

321321
fn run(this: &mut Self::MpTy, input: Self::RustArgs) -> Self::RustRet {
322-
// Implementation taken from `rug::Float::to_f32_exp`.
323322
this.assign(input.0);
324-
let exp = this.get_exp().unwrap_or(0);
325-
if exp != 0 {
326-
*this >>= exp;
327-
}
328-
323+
let exp = this.frexp_mut();
329324
(prep_retval::<Self::FTy>(this, Ordering::Equal), exp)
330325
}
331326
}

0 commit comments

Comments
 (0)