Message31529
Python's behavior with respect to floating point arithmetic is left to the platform's C floating point libraries. For example, on my Windows machine running Python 2.3.5, float("infinity") raises a ValueError. I would also point out that 0/0 is integer division in Python 2.3.5 .
For other examples of platform-specific behavior:
Python 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> inf*0
-1.#IND
>>> inf**0
1.0
>>> 1**inf
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: (33, 'Domain error')
>>> inf*0
-1.#IND
>>> inf/inf
-1.#IND
>>> inf-inf
-1.#IND
>>>
So yeah. If you don't like how Python does math, complain to your vendor (Apple) or compile a version of Python with a C floating point library that works the way you want it to. |
|
Date |
User |
Action |
Args |
2007-08-23 14:52:29 | admin | link | issue1681671 messages |
2007-08-23 14:52:29 | admin | create | |
|