[Numpy-discussion] A couple more Numeric incompatibilitiesand a possible bug

Gary Ruben gazzar at email.com
Sun Mar 28 16:51:17 EST 2004

> I'm guessing,  but I think you would like to see:
> >>> abs(-1.)
> 1.0
> >>> abs(1)
> 1

Hi Todd,

Sorry if I wasn't clear. Yes, that's what I was expecting to see. Thanks for logging it and thanks for the explanation of why it's happening.

I'd also like to restate the other issues in the email to which that one referred, which haven't been commented on. The cos function result

>>> cos(1)

gives a different result to cos(1.)
Is this just because of numarray's stated departures from the way type coercion is done in Numeric? My guess is that numarray is casting the integer to a rank-0 Float32 array which is then coerced back to the native Python float type, which presumably is a float64 on the Windows platform. Do others think precision is being lost unnecessarily?

Finally, has anyone got any comment about whether the __repr__ versus __str__ display of object array members is the expected behaviour?


Sign-up for Ads Free at Mail.com

More information about the NumPy-Discussion mailing list