sin function in Excel

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?
 
B

Bernard Liengme

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
 
P

Pete_UK

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top