For some reason, I can't get COS to evaluate correctly for certain values.
The results I get are:
But it should be 1, 0, -1, 0 ,1. Why is not calculating correctly when it should evaluate to 0?
Thanks!
Code:
Dim Pi As Double
Pi = 3.14159265358979
Debug.Print (Cos(0))
Debug.Print (Cos(Pi / 2))
Debug.Print (Cos(Pi))
Debug.Print (Cos(3 * Pi / 2))
Debug.Print (Cos(2 * Pi))
The results I get are:
Code:
1
1.61554255216634E-15
-1
-4.62458305157398E-15
1
But it should be 1, 0, -1, 0 ,1. Why is not calculating correctly when it should evaluate to 0?
Thanks!