[Numpy-discussion] strange bug (original) (raw)
Alan G Isaac aisaac at american.edu
Tue Jun 20 01🔞16 EDT 2006
- Previous message (by thread): [Numpy-discussion] hail seductive
- Next message (by thread): [Numpy-discussion] strange bug
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I think there is a bug in the **= operator, for dtype=float.
Alan Isaac
Script:
import numpy print "numpy.version: ", numpy.version ''' Illustrate a strange bug: ''' y = numpy.arange(10,dtype=float) print "y: ",y y *= y print "y**2: ",y z = numpy.arange(10,dtype=float) print "z: ", z z = 2 print "z2: ", z
Output:
numpy.version: 0.9.8 y: [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9.] y2: [ 0. 1. 4. 9. 16. 25. 36. 49. 64. 81.] z: [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9.] z2: [ 0.00000000e+00 1.00000000e+00 1.60000000e+01 8.10000000e+01 2.56000000e+02 6.25000000e+02 1.29600000e+03 2.40100000e+03 4.09600000e+03 6.56100000e+03]
- Previous message (by thread): [Numpy-discussion] hail seductive
- Next message (by thread): [Numpy-discussion] strange bug
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]