A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-August/037427.html below:

[Python-Dev] histerical math.log(zero)

[Python-Dev] histerical math.log(zero) [Python-Dev] histerical math.log(zero)Tim Peters tim.one at comcast.net
Mon Aug 4 14:23:26 EDT 2003
[Samuele Pedroni]
> I was asking this because I have just finished making jython handle
> log(long) itself too. And I noticed that test_long is picky about the
> ValueError thing.

It could test for one of (ValueError, OverflowError, ZeroDivisionError)
instead, and also count no exception as a success.  We probably see all 4 of
those behaviors in CPython across platforms for log(0.0).
Python-the-language doesn't really define exceptional math behaviors.

> I should have read the manual, sorry. I was more wondering that
> there's no encompassing math exception.

Ask Guido <wink>:

    CPython started life with "classic" (pre-754) libms, where ERANGE got
    mapped to OverflowError and EDOM to ValueError.

IOW, there has never been an encompassing math exception.  ArithmeticError
may have been an attempt to create one, but ValueError doesn't derive from
it so if that was the plan, it didn't work.


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