[pypy-issue] Issue #2101: cast float to bool spurious behaviour (pypy/pypy)
issues-reply at bitbucket.org
Wed Jul 29 11:58:06 CEST 2015
New issue 2101: cast float to bool spurious behaviour
Related to #2087 float cast to bool is handled wrong in the JIT. Consider this example:
from _numpypy import multiarray as np
import numpy as np
a = np.array( * 100, dtype='float')
a = 0.1
for i in range(10000):
Python 2.7.10 does not assert, whereas PyPy 2.6.0 does.
Problem: JIT emits cast_float_to_int, which cuts of the numbers after the comma. The right behavior would be to use float_is_ture. See 4fead7c7623f (jtransform.py & flatten.py)
Can someone confirm that this is the right solution?
More information about the pypy-issue