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

Commit 2d814b3

Browse files
committed
Try to fix #170
Signed-off-by: Benjamin Schultzer <[email protected]>
1 parent fb0547e commit 2d814b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/math/jnf.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ pub fn jnf(n: i32, mut x: f32) -> f32 {
169169
b = 2.0 * (i as f32) * b / x - a;
170170
a = temp;
171171
/* scale b to avoid spurious overflow */
172-
let x1p60 = f32::from_bits(0x5d800000); // 0x1p60 == 2^60
173-
if b > x1p60 {
172+
// let x1p60 = f32::from_bits(0x5d800000); // 0x1p60 == 2^60
173+
if b > 1.152922e+18 {
174174
a /= b;
175-
t /= b;
175+
t = t / b;
176176
b = 1.0;
177177
}
178178
i -= 1;

0 commit comments

Comments
 (0)