Why doesn't the sin function in Excel give me the same result for
sIn(2*pi()), sin(4*pi()), sin(6*pi()), etc?
Bernard Liengme - 16 Mar 2008 18:44 GMT
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/default.aspx?scid=http://support.microsoft.com:80/s
upport/kb/articles/Q279/7/55.ASP&NoWebContent=1
To avoid the problem use =ROUND(SIN(2*PI()), 15) to get 0.000000000000000
best wishes

Signature
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email
> Why doesn't the sin function in Excel give me the same result for
> sIn(2*pi()), sin(4*pi()), sin(6*pi()), etc?
Pete_UK - 16 Mar 2008 18:45 GMT
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
On Mar 16, 4:11 pm, jriv...@gmail.com wrote:
> Why doesn't the sin function in Excel give me the same result for
> sIn(2*pi()), sin(4*pi()), sin(6*pi()), etc?