This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Optimize pow(x,0.0) = pow(1.0,y) = 1.0
- From: Michael Matz <matz at suse dot de>
- To: Roger Sayle <roger at www dot eyesopen dot com>
- Cc: Andrew Pinski <apinski at apple dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 21 Feb 2003 17:41:11 +0100 (CET)
- Subject: Re: [PATCH] Optimize pow(x,0.0) = pow(1.0,y) = 1.0
On Fri, 21 Feb 2003, Roger Sayle wrote:
> pow(x,+-0) returns 1 for any x, even a NaN.
> I apologise that my reference is non-authorative. Can someone
> confirm the wording in the actual ISO C99 specification?
188.8.131.52 #2 [describing pow (x, y)]
... A domain error may occur if x is zero and y is less than or equal to
Note the _may_. One could argue, that optimizing pow(0,0) to 1.0 is
permitted. Just when you call the external routines you have to expect