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.

  • Participants
  • Parent commits d6424b5

Comments (0)

Files changed (1)

File pypy/rpython/lltypesystem/module/

     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.