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

Commit d114d48

Browse files
committed
fixup! Add tests against MPFR for scalbn{f} and ldexp{f}
1 parent be982af commit d114d48

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

crates/libm-test/src/mpfloat.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,12 @@ macro_rules! impl_op_for_ty_all {
334334

335335
fn run(this: &mut Self::MpTy, input: Self::RustArgs) -> Self::RustRet {
336336
this.0.assign(input.0);
337-
this.1.assign(2.0);
338-
this.1.pow_assign(input.1);
339-
let ord = this.0.mul_assign_round(&this.1, Nearest);
337+
let mut ord = Ordering::Equal;
338+
if this.0.is_finite() {
339+
this.1.assign(2.0);
340+
this.1.pow_assign(input.1);
341+
ord = this.0.mul_assign_round(&this.1, Nearest);
342+
}
340343
prep_retval::<Self::FTy>(&mut this.0, ord)
341344
}
342345
}

0 commit comments

Comments
 (0)