Hi
Gordon,
I understand how frustrating it can be when Excel doesn't give you the right answer. The issue you're experiencing with the
COS function is actually a common problem with floating-point arithmetic in computers.
To fix this issue, you can use the
ROUND function to round the result of the
COS function to the desired number of decimal places. Here's how you can do it:
- In a cell, enter the angle in radians. To convert degrees to radians, use the function. For example, to find the cosine of 90 degrees, you would enter .
- The result will be a very small number, as you've noticed. To round it to zero decimal places, use the ROUND function. For example, to round the result to zero decimal places, you would enter
Code:
=ROUND(COS(RADIANS(90)),0)
.
- The result should now be zero, as expected.