View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Sandy Mann Sandy Mann is offline
external usenet poster
 
Posts: 2,345
Default Cosine Function Returns Wrong Answer!

Excel uses the IEEE Standard for Double Precision Floating Point numbers
which is only accurate to 15 decimal places. Round the answer thus:

=ROUND(COS(A1/180*PI()),15)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Gordon Arnaut" wrote in message
...
I have a problem with my Excel 2002 that is driving me nuts.

The cosine function returns the wrong answer for the cosine of 90 degrees.
The right answer is zero, of course, but Excel insists on returning a very
small number, 6e-17.

Cosine works fine for all other angles -- both smaller and larger than 90
degrees.

What the heck is going on? Even the simple little calculator that comes
with
Windows gives the right answer.

Can anyone help?

Regards,

Gordon Arnaut
Ontario, Canada.