Possible bug (was Re: numpy, overflow, inf, ieee, and rich comparison)

William Park parkw at better.net
Wed Oct 11 23:40:38 EDT 2000


On Wed, Oct 11, 2000 at 10:44:20PM -0400, Tim Peters wrote:
> > Likewise sqrt(-1.) needs to stop, not put a zero and keep going.

Hmm... I don't like this.  It should stop or return complex.


> Nobody has proposed changing anything about libm domain (as opposed to
> range) errors (although Huaiyu probably should if he's serious about his
> flavor of 754 subsetism -- I have no idea what gcc+glibc+Linux did here on
> 1.5.2, but it *should* have silently returned a NaN (not a zero) without
> setting errno if it was *self*-consistent -- anyone care to check that
> under -lieee?:
> 
>     import math
>     math.sqrt(-1)
> 
> NaN or ValueError?  2.0 should raise ValueError regardless of what 1.5.2 did
> here.).

It returns 'OverflowError: math range error' in 1.5.2, and 'ValueError:
math domain error' in 2.0.


---William Park, Open Geometry Consulting




More information about the Python-list mailing list