RELEASED: Python 2.2.1c1

Gerhard Häring gerhard at bigfoot.de
Tue Mar 19 06:57:20 EST 2002


Tim Peters wrote:
> [Michael Hudson]
> 
>>I would ask those of you with access to the more
>>unusual platforms (i.e. not Linux/x86, Win32/x86) to run test_math in
>>verbose mode
> 
> 
> [Gerhard Häring]
> 
>>How would I do that?
> 
> 
> python Lib/test/test_math.py
 > [...]
> The last part ("exceptions") isn't normally run.  If it's unhappy, it will
> blow up (raise some sort of exception).

That's why I asked. I get this:

bash-2.05$ ../../python test_math.py
math module, testing with eps 1e-05
constants
acos
asin
atan
atan2
ceil
cos
cosh
exp
fabs
floor
fmod
frexp
hypot
ldexp
log
log10
modf
pow
sin
sinh
sqrt
tan
tanh
exceptions
Traceback (most recent call last):
   File "test_math.py", line 195, in ?
     test_exceptions()
   File "test_math.py", line 192, in test_exceptions
     raise TestFailed("sqrt(-1) didn't raise ValueError")
test_support.TestFailed: sqrt(-1) didn't raise ValueError
bash-2.05$ ../../python
Python 2.2.1c1 (#2, Mar 19 2002, 03:54:46)
[GCC 2.95.3 20010315 (release) [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
 >>> import math
 >>> math.sqrt(-1)
NaN
 >>>

Guess that's normal? I get the same with Python 2.2 on FreeBSD. Python 
2.1 raises an OverflowError instead.

Gerhard





More information about the Python-list mailing list