Path: news.mathworks.com!not-for-mail
From: Peter Perkins <Peter.PerkinsRemoveThis@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: cos(pi/2)   or    sin(-pi)   problem
Date: Mon, 19 Jan 2009 11:13:04 -0500
Organization: The MathWorks, Inc.
Lines: 5
Message-ID: <gl28qg$r$1@fred.mathworks.com>
References: <15244285.1232199505643.JavaMail.jakarta@nitrogen.mathforum.org> <gksq8p$61f$1@fred.mathworks.com> <gkvt2k$4ab$1@fred.mathworks.com> <gl052t$fhb$1@fred.mathworks.com>
NNTP-Posting-Host: perkinsp.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1232381584 27 172.31.57.88 (19 Jan 2009 16:13:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 19 Jan 2009 16:13:04 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
In-Reply-To: <gl052t$fhb$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:512492

Roger Stafford wrote:

>   Strictly speaking that isn't quite true, Peter.  It is impossible for 'cos' and 'sin' to return the exactly correct values for angles which are only rational approximations to pi/2 and pi, respectively, because the exact answers would themselves be irrational.

Sure.  I mean "correct" in the sense that those values are the correct floating point values for the sin and cos of the floating point approximations to pi/2 and -pi.