sin function in Excel

  • Thread starter Thread starter jrive87
  • Start date Start date
J

jrive87

Why doesn't the sin function in Excel give me the same result for
sIn(2*pi()), sin(4*pi()), sin(6*pi()), etc?
 
The values (aprox -2.4E-16, -4.90E-16, -7.35E-16) are all to be interpreted
as 0 since Excel has a precision of 15 decimal places. This is not just an
Excel problem, it arises from the way computer convert decimal values to
binary (base 10 numbers to base 2 numbers) with a finite number of bytes.
For more info read these:

Floating-point arithmetic may give inaccurate results in Excel
http://support.microsoft.com/kb/78113/en-us
(Complete) Tutorial to Understand IEEE Floating-Point Errors
http://support.microsoft.com/kb/42980
What Every Computer Scientist Should Know About Floating Point
http://docs.sun.com/source/806-3568/ncg_goldberg.html
http://www.cpearson.com/excel/rounding.htm
Visual Basic and Arithmetic Precision
http://support.microsoft.com/defaul...port/kb/articles/Q279/7/55.ASP&NoWebContent=1

To avoid the problem use =ROUND(SIN(2*PI()), 15) to get 0.000000000000000
best wishes
 
There are 2*pi radians in a circle, so this is the same as sin(360),
sine(720) etc where the angles are in degrees.

Hope this helps.

Pete
 
Back
Top