[pypy-commit] lang-smalltalk default: fixed infinity-retrieval to be RPython-compatible
lwassermann
noreply at buildbot.pypy.org
Wed May 29 21:53:49 CEST 2013
Author: Lars Wassermann <lars.wassermann at gmail.com>
Branch:
Changeset: r423:78905cdad21d
Date: 2013-05-29 21:53 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/78905cdad21d/
Log: fixed infinity-retrieval to be RPython-compatible
diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -296,14 +296,15 @@
@expose_primitive(FLOAT_TIMES_TWO_POWER, unwrap_spec=[float, int])
def func(interp, s_frame, rcvr, arg):
+ from rpython.rlib.rfloat import INFINITY
# http://www.python.org/dev/peps/pep-0754/
try:
return interp.space.wrap_float(math.ldexp(rcvr, arg))
except OverflowError:
if rcvr >= 0.0:
- return model.W_Float(float('inf'))
+ return model.W_Float(INFINITY)
else:
- return model.W_Float(float('-inf'))
+ return model.W_Float(-INFINITY)
@expose_primitive(FLOAT_SQUARE_ROOT, unwrap_spec=[float])
def func(interp, s_frame, f):
More information about the pypy-commit
mailing list