8000 Use Approx() macro for fuzzy comparison · Keating950/ArduinoCore-API@8eb4013 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8eb4013

Browse files
committed
Use Approx() macro for fuzzy comparison
1 parent 129ae52 commit 8eb4013

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/src/Stream/test_parseFloat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ TEST_CASE ("Testing parseFloat(LookaheadMode lookahead = SKIP_ALL, char ignore =
4848
WHEN ("A float is provided with too many digits")
4949
{
5050
mock << "3.1415926535897932384";
51-
REQUIRE(abs(mock.parseFloat() - 3.141592654f) < 8 * FLT_EPSILON);
51+
REQUIRE(mock.parseFloat() == Approx(3.141592654f));
5252
}
5353
}
5454

0 commit comments

Comments
 (0)
0