lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

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.

Adam Strzelecki