Commits

Antonio Cuni committed 164b6fb

implement math.isnan for cli

Comments (0)

Files changed (2)

pypy/rpython/test/test_rfloat.py

             s = ['42.3', '123.4'][i]
             return rstring_to_float(s)
         assert self.interpret(fn, [0]) == 42.3
+
+    def test_isnan(self):
+        import math
+        def fn(x):
+            inf = x * x
+            nan = inf / inf
+            return math.isnan(nan)
+        assert self.interpret(fn, [1e200])
+
+        
         
 class TestLLtype(BaseTestRfloat, LLRtypeMixin):
 

pypy/translator/cli/src/ll_math.cs

             return Math.Tanh(x);
         }
 
+        static public bool ll_math_isnan(double x)
+        {
+            return double.IsNaN(x);
+        }
+
         static public double ll_math_copysign(double x, double y)
         {
             if (x < 0.0)