The Sine function in the prelude is not behaving as I expected. In the following Hugs session I tested sin on 0, 90,180 & 360 degrees.

Prelude> sin 0
0.0                                 --correct
Prelude> sin (pi/2)
1.0                                 --correct
Prelude> sin pi
1.22460635382238e-16  --WRONG!
Prelude> sin (2*pi)
-2.44921270764475e-16 --WRONG!

Is this normal behaviour? Or am I using the trig functions in an unexpected way?

Thanks...
Deech


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to