[Python-Dev] should a float overflow or just equal 'inf' (original) (raw)

Trent Mick trentm@activestate.com
Fri, 5 May 2000 14:34:48 -0700


Hi all,

I submitted a patch a coupld of days ago to have the 'b', 'i', and 'h' formatter for PyArg_ParseTuple raise an Overflow exception if they overflow (currently they just silently overflow). Presuming that this is considered a good idea, should this be carried to floats.

Floats don't really overflow, they just equal 'inf'. Would it be more desireable to raise an Overflow exception for this? I am inclined to think that this would not be desireable based on the following quote:

""" the-754-committee-probably-did-the-best-job-of-fixing-binary-fp- that-can-be-done-ly y'rs - tim """

In any case, the question stands. I don't really have an idea of the potential pains that this could cause to (1) efficiecy, (2) external code that expects to deal with 'inf's itself. The reason I ask is because I am looking at related issues in the Python code these days.

Trent

Trent Mick trentm@activestate.com