Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r49032:2466f0e89311
Date: 2011-11-09 19:00 +0100
http://bitbucket.org/pypy/pypy/changeset/2466f0e89311/

Log:    Tweak.

diff --git a/pypy/rpython/lltypesystem/module/ll_math.py 
b/pypy/rpython/lltypesystem/module/ll_math.py
--- a/pypy/rpython/lltypesystem/module/ll_math.py
+++ b/pypy/rpython/lltypesystem/module/ll_math.py
@@ -108,14 +108,17 @@
 #
 # Custom implementations
 
+VERY_LARGE_FLOAT = 1.0
+while VERY_LARGE_FLOAT * 100.0 != INFINITY:
+    VERY_LARGE_FLOAT *= 64.0
+
 def ll_math_isnan(y):
     # By not calling into the external function the JIT can inline this.
     # Floats are awesome.
     return y != y
 
 def ll_math_isinf(y):
-    # Use a bitwise OR so the JIT doesn't produce 2 different guards.
-    return (y == INFINITY) | (y == -INFINITY)
+    return (y + VERY_LARGE_FLOAT) == y
 
 def ll_math_isfinite(y):
     # Use a custom hack that is reasonably well-suited to the JIT.
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to