Bill Allombert on Thu, 30 Jun 2005 19:14:52 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Sin(x)


On Thu, Jun 30, 2005 at 06:33:11PM +0200, Sascha Rissel wrote:
> Hello,
> 
> I have a qustion about the sin(x)-function.
> 
> Why is cos(Pi) = -1 as it should be, but sin(Pi) = -5.04870979 E-29 and 
> not exactly 0?
> Other values of sin(x) are also a bit "out of place"...

cos(Pi) is not really -1:
? cos(Pi)+1
%3 = 1.2744735289059618216 E-57

The Pi function returns only an approximation of Pi to the current
precision, so the result can only be accurate to that number of
decimals.

Cheers,
Bill.