Hi, In [48]: int32(1)/int32(0) Out[48]: 0 Why is the result not inf? (I looked up IEEE 854 but do not understand a word...) Johannes -- Echte DSL-Flatrate dauerhaft f�r 0,- Euro*! "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
IEEE special values only apply to floating types, not integers. If you think about it a bit, you'll understand why (what bit pattern isn't a valid integer?). And you probably mean IEEE 754, not 854. On Mar 29, 2006, at 10:04 AM, Johannes Löhnert wrote:
Hi,
In [48]: int32(1)/int32(0) Out[48]: 0
Why is the result not inf? (I looked up IEEE 854 but do not understand a word...)
Johannes
-- Echte DSL-Flatrate dauerhaft für 0,- Euro*! "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
_______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.net http://www.scipy.net/mailman/listinfo/scipy-dev
Perry Greenfield schrieb:
IEEE special values only apply to floating types, not integers. If you think about it a bit, you'll understand why (what bit pattern isn't a valid integer?). And you probably mean IEEE 754, not 854.
Point taken, but I would find it better if a ZeroDivision Error was raised. (If you try 1/0 with Python's native integers, this happens.) 1/0 giving back 0 silently is a Bad Thing imho. Johannes
participants (3)
-
"Johannes Löhnert" -
aurelian -
Perry Greenfield