On 12 November 2013 12:01, Bart Baker <[email protected]> wrote:

> The issue is that there are some minor (10^-16) differences in the
> values when I do the calculation in C vs Python.
>

That is the order of the machine epsilon for double, that looks like
roundoff errors to me.

 I found similar results cythonising some code, everything was the same
until I changed some numpy functions for libc functions (exp, sin, cos...).
After some operations in float32, the results were apart for 1 in 10^-5
(the epsilon is 10^-6). I blame them on specific implementation differences
between numpy's and my system's libc specific functions.

To check equality, use np.allclose, it lets you define the relative and
absolute error.


/David.
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to