Skip to content

Commit 885a098

Browse files
committed
fix: handle signed infinty in prec::almost_eq
1 parent 09939ce commit 885a098

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/prec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub const DEFAULT_F64_ACC: f64 = 0.0000000000000011102230246251565;
1313
/// using a maximum absolute difference (epsilon) of `acc`.
1414
pub fn almost_eq(a: f64, b: f64, acc: f64) -> bool {
1515
if a.is_infinite() && b.is_infinite() {
16-
return true;
16+
return a == b;
1717
}
1818
a.abs_diff_eq(&b, acc)
1919
}

0 commit comments

Comments
 (0)