Author: Brian Kearns <[email protected]>
Branch:
Changeset: r67470:90289b2c633b
Date: 2013-10-17 19:59 -0400
http://bitbucket.org/pypy/pypy/changeset/90289b2c633b/
Log: fix reciprocal on 32bit
diff --git a/pypy/module/micronumpy/test/test_ufuncs.py
b/pypy/module/micronumpy/test/test_ufuncs.py
--- a/pypy/module/micronumpy/test/test_ufuncs.py
+++ b/pypy/module/micronumpy/test/test_ufuncs.py
@@ -315,16 +315,16 @@
for i in range(4):
assert b[i] == reference[i]
- for dtype in ['int8', 'int16', 'int32', 'int64',
- 'uint8', 'uint16', 'uint32', 'uint64']:
+ for dtype in 'bBhHiIlLqQ':
+ a = array([-2, -1, 0, 1, 2], dtype)
reference = [0, -1, 0, 1, 0]
+ dtype = a.dtype.name
if dtype[0] == 'u':
reference[1] = 0
elif dtype == 'int32':
reference[2] = -2147483648
elif dtype == 'int64':
reference[2] = -9223372036854775808
- a = array([-2, -1, 0, 1, 2], dtype)
b = reciprocal(a)
assert (b == reference).all()
diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -510,7 +510,7 @@
ans = 0
if raw == 0:
# XXX good place to warn
- if self.T is rffi.INT or self.T is rffi.LONG:
+ if self.T is rffi.INT or self.T is rffi.LONG or self.T is
rffi.LONGLONG:
ans = most_neg_value_of(self.T)
elif abs(raw) == 1:
ans = raw
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit