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

From: Jason Riedy <jason_at_acm.org>
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
  http://grouper.ieee.org/groups/754/meeting-materials/2001-07-18-c99.pdf or in an html version in the meeting notes at   http://grouper.ieee.org/groups/754/meeting-minutes/01-07-18.html

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



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel 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 https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive