Turn off ZeroDivisionError?

Christian Heimes lists at cheimes.de
Sun Feb 10 23:57:39 CET 2008

Grant Edwards wrote:
> A more efficient implementation?  Just delete the code that
> raises the exception and the HW will do the right thing.

Do you really think that the hardware and the C runtime library will do
the right thing? Python runs on a lots platforms and architectures. Some
of the platforms don't have a FPU or don't support hardware acceleration
for floating point ops for user space applications. Some platforms don't
follow IEEE 754 semantics at all.

It took us a lot of effort to get consistent results for edge cases of
basic functions like sin and atan on all platforms. Simply removing
those lines and praying that it works won't do it.


More information about the Python-list mailing list