[Numpy-discussion] what goes wrong with cos(), sin()
Wed Feb 21 15:35:36 CST 2007
On 2/21/07, Christopher Barker <Chris.Barker@noaa.gov> wrote:
> Anne Archibald wrote:
> > Or, to see more clearly, try taking (on a pocket calculator, say)
> > sin(3.14) (or even sin(pi)).
> This is an interesting point. I took a class from William Kahan once
> (pass/fail, thank god!), and one question he posed to us was:
> How many digits of pi is used in an HP calculator?
> I never figured out the answer myself, and the question involved the
> info that certain calculations involving pi being accurate to a certain
> degree. I don't have my HP calculator with me right now but I suspect
> that sin(pi) might well evaluate to exactly zero, or closer than 1e-16
Not on my HP calcularor. However, mine is 20+ years old and the label has
worn off so I'm not even sure what model it is any more (15c?). However,
sin(pi) is -4.1e-10 on this calculator, FWIW.
I wonder if there are any C math libs that do a better job than you'd
> expect from standard FP? (short of unlimited precision ones)
> Christopher Barker, Ph.D.
> Emergency Response Division
> NOAA/NOS/OR&R (206) 526-6959 voice
> 7600 Sand Point Way NE (206) 526-6329 fax
> Seattle, WA 98115 (206) 526-6317 main reception
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion