Use ldexp from cmath instead
This commit is contained in:
parent
7143ccc8fa
commit
e1d1cd191f
@ -594,8 +594,10 @@ fn emulate_foreign_item(
|
||||
// FIXME: Using host floats.
|
||||
let x = f64::from_bits(this.read_scalar(args[0])?.to_u64()?);
|
||||
let exp = this.read_scalar(args[1])?.to_i32()?;
|
||||
// FIXME: We should use cmath if there are any imprecisions.
|
||||
let n = x * 2.0f64.powi(exp);
|
||||
extern {
|
||||
fn ldexp(x: f64, n: i32) -> f64;
|
||||
}
|
||||
let n = unsafe { ldexp(x, exp) };
|
||||
this.write_scalar(Scalar::from_u64(n.to_bits()), dest)?;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user