[pypy-svn] pypy ootype-virtualrefs: implement isinf for cli

antocuni commits-noreply at bitbucket.org
Thu Apr 7 17:12:55 CEST 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: ootype-virtualrefs
Changeset: r43202:ff657dd939b8
Date: 2011-04-07 17:11 +0200
http://bitbucket.org/pypy/pypy/changeset/ff657dd939b8/

Log:	implement isinf for cli

diff --git a/pypy/rpython/test/test_rfloat.py b/pypy/rpython/test/test_rfloat.py
--- a/pypy/rpython/test/test_rfloat.py
+++ b/pypy/rpython/test/test_rfloat.py
@@ -179,7 +179,13 @@
             return math.isnan(nan)
         assert self.interpret(fn, [1e200])
 
-        
+    def test_isinf(self):
+        import math
+        def fn(x):
+            inf = x * x
+            return math.isinf(inf)
+        assert self.interpret(fn, [1e200])
+
         
 class TestLLtype(BaseTestRfloat, LLRtypeMixin):
 

diff --git a/pypy/translator/cli/src/ll_math.cs b/pypy/translator/cli/src/ll_math.cs
--- a/pypy/translator/cli/src/ll_math.cs
+++ b/pypy/translator/cli/src/ll_math.cs
@@ -230,6 +230,11 @@
             return double.IsNaN(x);
         }
 
+        static public bool ll_math_isinf(double x)
+        {
+            return double.IsInfinity(x);
+        }
+
         static public double ll_math_copysign(double x, double y)
         {
             if (x < 0.0)


More information about the Pypy-commit mailing list