math.cos not working as expected

I need to fetch the value of cos(90) at a point in my code. But I didn’t get the expected value 0.  So I write two print lines to test.

[lua]print( math.deg(math.acos( 0 )) )
print( math.cos(math.rad(90)) )[/lua]

Here’s what I got:

18:10:04.399  90

18:10:04.399  6.1232339957368e-017

Its supposed to be 0 here but I got something else.

Is that a bug?

any base to e-17 is effectively zero for a calculated double-precision value

you could round all results to say 15 decimals if you require that it equal zero

any base to e-17 is effectively zero for a calculated double-precision value

you could round all results to say 15 decimals if you require that it equal zero