Skip to content

Commit f3597e7

Browse files
committed
Check inf value properly
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]
1 parent a21b3b3 commit f3597e7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/unit-math/test-math.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ check_double (const char *expr, double computed, double expected)
7474
if (diff <= 1) /* tolerate 1 bit of differene in the last place */
7575
{
7676
result = true;
77-
if (diff != 0)
77+
if (isinf (expected) && diff != 0)
78+
{
79+
result = false;
80+
}
81+
else if (diff != 0)
7882
{
7983
printf ("APPROX ");
8084
}

0 commit comments

Comments
 (0)