Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r84840:09b703c1e5e6
Date: 2016-05-30 20:51 +0200
http://bitbucket.org/pypy/pypy/changeset/09b703c1e5e6/

Log:    This version uses a "-" instead of a "*", which is a tiny bit faster

diff --git a/rpython/rtyper/lltypesystem/module/ll_math.py 
b/rpython/rtyper/lltypesystem/module/ll_math.py
--- a/rpython/rtyper/lltypesystem/module/ll_math.py
+++ b/rpython/rtyper/lltypesystem/module/ll_math.py
@@ -132,8 +132,7 @@
     # Floats are awesome (bis).
     if use_library_isinf_isnan and not jit.we_are_jitted():
         return bool(_lib_finite(y))
-    z = 0.0 * y
-    return z == z       # i.e.: z is not a NaN
+    return (y - y) == 0.0    # (y - y) is NaN if y is an infinite or NaN
 
 
 ll_math_floor = math_floor
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to