[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Deviation in math functions
- From: Adam Strzelecki <ono@...>
- Date: Fri, 10 Feb 2012 15:08:28 +0100
Even if math.sin produced exact results (but it does not) still the math.rad(270) which is 1 ½ PI irrational number cannot be represented exactly by the computer. I guess instead of doing math.cos(math.rad(x)) you could lookup the values from some precomputed table for integer degrees or fractions of PI, this would guarantee you exact values for 0, 90, 180, 270 degrees.
Cheers,
--
Adam Strzelecki