Re: [Rd] 0 ^ NaN == Inf, why?

From: Jason Riedy <>
Date: Mon, 27 Oct 2008 09:31:00 -0400

And John Chambers writes:
> I tried a little harder, and apparently the guess is wrong. It seems
> that pow(0, -0) is 1 in C. Would seem better to either have pow(0,0)
> and pow(0,-0) both be NaN or else 1 and Inf, but ...

There are slides from Jim Thomas summarizing the C99 choices for elementary functions at or in an html version in the meeting notes at

IIRC, pow(x, +/- 0) is taken to be 1 for all x because pow(x, 0) = 1 and pow(x, -0) = 1/pow(x, 0) = 1/1 = 1 for all finite, numerical, non-zero x. The NCEG folks spent a huge effort considering mathematical reasons and actual applications when they chose the special case values. Disagreements over special cases are natural, alas, but they did the best anyone really could.

Jason mailing list Received on Mon 27 Oct 2008 - 15:24:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 27 Oct 2008 - 17:30:28 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive