View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default Cosine of 90 degrees

"mikelee101" <mikelee101athotmaildotcom wrote:
I was just curious why I wasn't getting zero for the result of the
cosine of a 90 degree angle. This formula
=COS(RADIANS(90))


I understand your expectation. Even though binary arithmetic often causes
subtle differences in results (e.g. IF(10.1-10=0.1,TRUE) returns FALSE!),
many implementations of transcendental and other math functions that are
implemented with approximating formulas make special cases for recognizable
boundary conditions.

For example, that is probably why COS(PI()) is exactly -1.

Since RADIANS(90) returns exactly the same binary result as PI()/2, and
PI()/2 is exactly the binary representation of PI() divided by 2, there is
no reason why the COS() implementation cannot make a special case of
COS(RADIANS(90)) and return exactly zero.

But that's a judgment call. Obviously, the implementors have to draw a line
somewhere.


----- original message -----

"mikelee101" <mikelee101athotmaildotcom wrote in message
...
Hello All,
I was just curious why I wasn't getting zero for the result of the cosine
of
a 90 degree angle. This formula

=COS(RADIANS(90))

returns

6.12574E-17

when I would have expected 0. Am I misusing a function in there
somewhere?
Any thoughts would be greatly appreciated.

Excel 07, XPPro SP3.

Thanks.
--
Mike Lee
McKinney,TX USA