At 12:31 04.08.2003 -0400, Tim Peters wrote: >[Samuele Pedroni] > > math.log raises different unrelated exceptions depending on the type > > of a zero argument: > >It may, and probably does on most platforms. Which exception gets raised >for a float 0.0, and even whether an exception gets raised at all in that >case, depends on what the platform libm does. Standard C allows a lot of >variation here. > > > >>> math.log(0) > > > > Traceback (most recent call last): > > File "<pyshell#1>", line 1, in -toplevel- > > math.log(0) > > OverflowError: math range error > > >>> math.log(0L) > >Python handles log(long) itself, so the exception in this case is >platform-independent. 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. I should have read the manual, sorry. I was more wondering that there's no encompassing math exception. regards.
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