Skip to content

Commit

Permalink
Try to fix rust-lang#170
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Schultzer <[email protected]>
  • Loading branch information
Schultzer committed Jul 3, 2019
1 parent fb0547e commit 2d814b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/math/jnf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ pub fn jnf(n: i32, mut x: f32) -> f32 {
b = 2.0 * (i as f32) * b / x - a;
a = temp;
/* scale b to avoid spurious overflow */
let x1p60 = f32::from_bits(0x5d800000); // 0x1p60 == 2^60
if b > x1p60 {
// let x1p60 = f32::from_bits(0x5d800000); // 0x1p60 == 2^60
if b > 1.152922e+18 {
a /= b;
t /= b;
t = t / b;
b = 1.0;
}
i -= 1;
Expand Down

0 comments on commit 2d814b3

Please sign in to comment.