Skip to content

Commit 2c0d537

Browse files
committed
Adjust the allowed floating point error in tests.
1 parent 91968e3 commit 2c0d537

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn almost_equals(a: &Json, b: &Json) -> bool {
6262
(_, &Json::I64(b)) => almost_equals(a, &Json::F64(b as f64)),
6363
(_, &Json::U64(b)) => almost_equals(a, &Json::F64(b as f64)),
6464

65-
(&Json::F64(a), &Json::F64(b)) => (a - b).abs() < 1e-6,
65+
(&Json::F64(a), &Json::F64(b)) => (a - b).abs() < 1. / 255.,
6666

6767
(&Json::Boolean(a), &Json::Boolean(b)) => a == b,
6868
(&Json::String(ref a), &Json::String(ref b)) => a == b,

0 commit comments

Comments
 (0)