Commits

Armin Rigo committed 14495ad

The hack "y + VERY_LARGE_FLOAT == y" fails to give the correct
result on gcc, not only on msvc. Revert to the comparison with
INFINITY and -INFINITY when not jitted.

Comments (0)

Files changed (1)

pypy/rpython/lltypesystem/module/ll_math.py

     return y != y
 
 def ll_math_isinf(y):
-    if use_library_isinf_isnan and not jit.we_are_jitted():
+    if jit.we_are_jitted():
+        return (y + VERY_LARGE_FLOAT) == y
+    elif use_library_isinf_isnan:
         return not _lib_finite(y) and not _lib_isnan(y)
-    return (y + VERY_LARGE_FLOAT) == y
+    else:
+        return y == INFINITY or y == -INFINITY
 
 def ll_math_isfinite(y):
     # Use a custom hack that is reasonably well-suited to the JIT.