We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
prec::almost_eq
1 parent 7fa8336 commit e8e9c61Copy full SHA for e8e9c61
src/prec.rs
@@ -12,6 +12,9 @@ pub const DEFAULT_F64_ACC: f64 = 0.0000000000000011102230246251565;
12
/// Compares if two floats are close via `approx::abs_diff_eq`
13
/// using a maximum absolute difference (epsilon) of `acc`.
14
pub fn almost_eq(a: f64, b: f64, acc: f64) -> bool {
15
+ if a.is_infinite() && b.is_infinite() {
16
+ return true;
17
+ }
18
a.abs_diff_eq(&b, acc)
19
}
20
0 commit comments