[pypy-svn] pypy ootype-virtualrefs: merge heads
antocuni
commits-noreply at bitbucket.org
Thu Apr 7 17:01:58 CEST 2011
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: ootype-virtualrefs
Changeset: r43201:3a314abb44d4
Date: 2011-04-07 17:00 +0200
http://bitbucket.org/pypy/pypy/changeset/3a314abb44d4/
Log: merge heads
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
@@ -170,6 +170,16 @@
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):
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
@@ -225,6 +225,11 @@
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)
More information about the Pypy-commit
mailing list