[pypy-commit] pypy default: fix handling of inf in jvm's frexp

pjenvey noreply at buildbot.pypy.org
Fri Jul 29 03:33:07 CEST 2011


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: 
Changeset: r46078:4d824e4fcf57
Date: 2011-07-28 18:32 -0700
http://bitbucket.org/pypy/pypy/changeset/4d824e4fcf57/

Log:	fix handling of inf in jvm's frexp

diff --git a/pypy/translator/jvm/src/pypy/PyPy.java b/pypy/translator/jvm/src/pypy/PyPy.java
--- a/pypy/translator/jvm/src/pypy/PyPy.java
+++ b/pypy/translator/jvm/src/pypy/PyPy.java
@@ -1100,9 +1100,9 @@
         if (Double.isNaN(x))
             return interlink.recordFloatSigned(x, 0);
 
-        // Infinity: Python throws exception
+        // Infinity: Python returns (inf, 0)
         if (Double.isInfinite(x))
-            interlink.throwOverflowError();
+            return interlink.recordFloatSigned(x, 0);
 
         // Extract the various parts of the format:
         final long e=11, f=52; // number of bits in IEEE format


More information about the pypy-commit mailing list