[PYTHON MATRIX-SIG] floating point handling

Hinsen Konrad hinsenk@ere.umontreal.ca
Fri, 3 Nov 1995 09:59:13 -0500


   If you insist on having "Inf" for infinity and "NaN" for 1/0, all you
   probably need to do is hack the floatobject.c module a wee bit, to
   include representations for them and to return them in appropriate

Indeed I don't think this is much work, having looked at the float
implementation quite a bit before writing the complex module. But
obviously there must be a way to enable or disable floating point
exceptions (I thing everyone agrees they are useful). I am not quite
sure what the appropriate way to do that would be - a variable in the
sys module would be nice, but probably expensive to check after each
float operation. A function with a boolean argument that sets a C
variable might be better. Or maybe there is a better way that I just
can't think of... The same flag could then be used in the complex and
matrix modules.

-------------------------------------------------------------------------------
Konrad Hinsen                     | E-Mail: hinsenk@ere.umontreal.ca
Departement de chimie             | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal            | Fax:  +1-514-343-7586
C.P. 6128, succ. Centre-Ville     | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7             | Francais (phase experimentale)
-------------------------------------------------------------------------------

=================
MATRIX-SIG  - SIG on Matrix Math for Python

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