delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/05/02/10:58:58

X-Spam-Check-By: sourceware.org
Message-ID: <ba40711f0705020758k3eb49747qa70b6161c4050e87@mail.gmail.com>
Date: Wed, 2 May 2007 10:58:22 -0400
From: "Lev Bishop" <lev DOT bishop AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: newlib?: pow function can produce incorrect results.
In-Reply-To: <548611.6765.qm@web59105.mail.re1.yahoo.com>
MIME-Version: 1.0
References: <548611 DOT 6765 DOT qm AT web59105 DOT mail DOT re1 DOT yahoo DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 5/1/07, Cary R. wrote:
> Patch generated and applied to newlib CVS. As an added  bonus I fixed a
> few other inconsistencies in acos(), asin(), log() and log10().

Just for the benefit of anyone else investigating this kind of thing
in the future, because I got confused by it and had to do some
searching, the "pow(x,0)=1, even for x=NaN" and "pow(-1,+-inf)=1"
rules are cases where the (freely available) earlier public drafts of
C99 differ from the final version of the standard (which you have to
purchase). This has confused other projects also, see eg:
http://lists.debian.org/debian-glibc/2003/03/msg00223.html

Other potentially controversial special cases (may or may not be
handled correctly by newlib -- I didn't check) are:
atan2(+-0,-0)=+-pi
atan2(+-0,+0)=+-0
hypot(+-inf,y)=+inf, even for y=NaN
fmax(x,NaN)=fmax(NaN,x)=fmin(x,NaN)=fmin(NaN,x)=x

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019