[Numpy-discussion] what goes wrong with cos(), sin()
David Goldsmith
David.L.Goldsmith@noaa....
Wed Feb 21 13:52:39 CST 2007
Anne Archibald wrote:
> On 21/02/07, Zachary Pincus <zpincus@stanford.edu> wrote:
>
>
>> A corrolary: in general do not two floating-point values for equality
>> -- use something like numpy.allclose. (Exception -- equality is
>> expected if the exact sequence of operations to generate two numbers
>> were identical.)
>>
>
> I really can't agree that blindly using allclose() is a good idea. For
> example, allclose(plancks_constant,0) and the difference leads to
> quantum mechanics... you really have to know how much difference you
> expect and how big your numbers are going to be.
>
> Anne
>
"Precisely!" ;-)
Last time we had a posting like this, didn't one of the respondents
include a link to something within the numpy Web docs that talks about
floating point precision?
DG
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
More information about the Numpy-discussion
mailing list