[MATRIX-SIG] Fix to NumPy10

Andrey Kaliazin KaliazinA@cardiff.ac.uk
Fri, 6 Mar 1998 22:22:37 -0000

> When item 4 of TODO is finished, you'll be able to turn on
> a signal handler for SIGFPE and catch the overflow you
> observed above. (Odd though it may seem, integer divide
> by zero and overflow will generate SIGFPE in most
> implementations.)  For the moment, it's neither a bug
>  nor a feature.  Until Python itself was capable of handling
> SIGFPE, it was impossible to do much of anything about it
> in NumPy (unless you were willing to give up most of NumPy's
> speed advantage by  checking all operands).

Sorry, if I was not clear enough.
(my english still have to be improved :-(

I just wanted to point out that pow() does not trap this error,
being applied to array, while it do it's best with single value:

>>> from Numeric import *
>>> pow(10,array([10]))


>>> pow(10,10)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
OverflowError: integer pow()

So, isn't it a bug?

Looking in TODO list (item 2), I would like to suggest to implement
"Inf" value (infinitive) additionally to a "NaN" .

(MATLAB shows elegant way and semantic to handle both)

Andy K.

MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org