about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2025-01-25 01:00:01 +0000
committerTrevor Gross <tmgross@umich.edu>2025-01-25 01:00:01 +0000
commitedd12893410c1fdcb73a4a365b28bd8a9b998e8a (patch)
treec33bd79dfab78d53bea59dcf8502e6aefc8b609d
parent62f0fd40d1ca80b11ad68f4d310069b76ed12aa5 (diff)
downloadrust-edd12893410c1fdcb73a4a365b28bd8a9b998e8a.tar.gz
rust-edd12893410c1fdcb73a4a365b28bd8a9b998e8a.zip
Use `frexp` from Rug
Rug 1.27.0 exposes `frexp`. Make use of it for our tests.
-rw-r--r--library/compiler-builtins/libm/crates/libm-test/src/mpfloat.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/library/compiler-builtins/libm/crates/libm-test/src/mpfloat.rs b/library/compiler-builtins/libm/crates/libm-test/src/mpfloat.rs
index e2be6584d23..6896425d157 100644
--- a/library/compiler-builtins/libm/crates/libm-test/src/mpfloat.rs
+++ b/library/compiler-builtins/libm/crates/libm-test/src/mpfloat.rs
@@ -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)
                 }
             }