1 May 2006 09:19
Re: Newbie: Haskell Sine Oddities
<ajb <at> spamcop.net>
2006-05-01 07:19:41 GMT
2006-05-01 07:19:41 GMT
G'day all.
Aditya Siram wrote:
> > Prelude> sin pi
> > 1.22460635382238e-16 --WRONG!
Quoting Scott Turner <p.turner <at> computer.org>:
> This value, the computer's pi, differs from true pi by
> 0.000000000000000122...
Exercise for those doing numeric analysis 101: Explain why
these two numbers are approximately the same.
And if you found that one too easy, show how quickly
following iteration converges to pi.
iterate (\x -> x + sin x) 1
Cheers,
Andrew Bromage
Thanks, Brian.
RSS Feed