[PYTHON MATRIX-SIG] floating point equalities

James Hugunin jjh@Goldilocks.LCS.MIT.EDU
Tue, 23 Jan 96 13:00:16 EST

In preparation for the 0.30 release (still on for Friday) I've been
cleaning up the array math functions.

I'm now working on improving the floating point equality operator.  My
understanding is that doing a == b is unreasonable for floating point
numbers, and instead the test should be something like 

abs(a-b) < TOLERANCE*abs(a)

Rather than have me try and rederive what this should look like from
my vague memories of the IEEE floating point standard, I was wondering
if anybody out there has a good chunk of code for doing this

Thanks, Jim  

MATRIX-SIG  - SIG on Matrix Math for Python

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