This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Optimize pow(x,0.0) = pow(1.0,y) = 1.0


Hi,

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?

7.12.7.4 #2 [describing pow (x, y)]
... A domain error may occur if x is zero and y is less than or equal to
zero.

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
domain errors.


Ciao,
Michael.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]