gmpy floating point exception
mmanns at gmx.net
Thu Mar 29 05:56:28 CEST 2007
I am experiencing some trouble with gmpy v1.01.
Multiplying an mpq with inf results in a floating point exception that
exits python. Has this already been fixed in newer gmpy versions?
~ $ python
Python 2.4.3 (#1, Mar 26 2007, 00:32:54)
[GCC 4.1.1 (Gentoo 4.1.1-r3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gmpy import mpq as Rational
Traceback (most recent call last):
File "<stdin>", line 1, in ?
OverflowError: cannot convert float infinity to long
Floating point exception
1) What is the best way to test for inf regardless of type?
2) Is there any inf type around with
a + inf == inf
inf > a (as long as a != inf)
that works with any other type?
Thanks in advance
More information about the Python-list