problem with the 'math' module in 2.5?

Chris chrispatton at gmail.com
Sat Oct 14 23:33:13 EDT 2006


>>> from math import *
>>> sin(0)
0.0
>>> sin(pi)
1.2246063538223773e-016
>>> sin(2*pi)
-2.4492127076447545e-016
>>> cos(0)
1.0
>>> cos(pi)
-1.0
>>> cos(2*pi)
1.0

The cosine function works fine, but I'm getting weird answers for sine.
Is this a bug? Am I doing something wrong?




More information about the Python-list mailing list