don't NaN & infinities hide FP errors

Batista, Facundo FBatista at uniFON.com.ar
Wed Nov 17 14:15:23 CET 2004


[kartick_vaddadi at yahoo.com]

#- Since Python floats are implemented using C doubles, 
#- assuming IEEE 754
#- compliance, certain operations should result in NaN or 
#- infinity. Don't
#- such special values hide errors? Would we want our variables to be in
#- such states? I feel it would be better if a floating point 
#- division by
#- zero (or other actions that produce NaNs or infinities) throws an
#- exception, just like an integer divide by zero.

Check Decimal FP, where you can control through the context, for example, if
0/0 returns NaN or throws an exception.

http://www.python.org/dev/doc/devel/lib/module-decimal.html

.	Facundo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20041117/aa8639d5/attachment.html>


More information about the Python-list mailing list