Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r49464:14495ad804bc Date: 2011-11-16 12:28 +0100 http://bitbucket.org/pypy/pypy/changeset/14495ad804bc/
Log: 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. 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 @@ -127,9 +127,12 @@ 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. _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit