[Numpy-discussion] what goes wrong with cos(), sin()

Robert Kern robert.kern@gmail....
Wed Feb 21 14:08:44 CST 2007


Christopher Barker wrote:
> 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)

With respect to π and the zeros of sin() and cos()? Not really. If
numpy.sin(numpy.pi) were to give you 0.0, it would be *wrong*. numpy.sin() is
supposed to give you the most accurate result representable in double-precision
for the input you gave it. numpy.pi is not π.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


More information about the Numpy-discussion mailing list