[Numpy-discussion] Floating Point Difference between numpy and numarray

David Cournapeau david@ar.media.kyoto-u.ac...
Wed Sep 3 05:29:16 CDT 2008


Hanni Ali wrote:
> I'm afraid the matrix is not available anywhere and I would not be
> able to make it available.
>

Forget it, Sebastian is right. I was confused by the range of the error,
but the error between two floating point numbers is indeed 1e-7 for
float on most runtimes (FLT_EPS in C, which is the minimal value such as
1. + FLT_EPS != 1.)

I am not sure whether we should define the accumulator to a double in
the float case by default; generally, you use float for saving memory
and computing speed, and you lose quite a bit speed-wise by using a
double accumulator. FWIW, matlab behaves as well (not that it is a
justification by itself, but at least it should not surprise matlab users).

cheers,

David


More information about the Numpy-discussion mailing list