A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-February/042419.html below:

[Python-Dev] math.sqrt(-1) - NaN, ValueError or whatever you want?

[Python-Dev] math.sqrt(-1) - NaN, ValueError or whatever you want?Hye-Shik Chang perky at i18n.org
Thu Feb 5 16:44:41 EST 2004
On Thu, Feb 05, 2004 at 09:44:07PM +0100, Jack Jansen wrote:
> The answers to my math questions never seem to stick, so I'm afraid I'm 
> gonna have to ask this question again (even though I think I did the 
> same a couple of years ago, but google doesn't find it).
> 
> It turns out that on MacOS math.sqrt(-1) returns "nan", as does 
> math.log(-1), and I didn't try any other ones.
> 
> This is true for all possible combinations of MacPython 2.3, 2.4a0 or 
> apple-Python 2.3, MacPython-OS9 or MacPython-OSX, and Mac OS 9 or Mac 
> OS X.
> 
> When I tried the same on a linux box (Python 2.4a0) it raised 
> ValueError: math domain error, which is what I would have expected.
> 
> Why this difference? Is it something I should fix? How? Or document it?

SF patch 871657* may apply to MacOS X, too.

* math.sqrt EDOM handling for FreeBSD: http://www.python.org/sf/871657


Hye-Shik

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4