Mail Archives: djgpp-workers/1999/06/09/13:10:50
Hans-Bernhard Broeker wrote:
> Therefore, this limit cannot possibly exist, and 0^0 cannot
> be given any single, well-defined value.
I agree entirely, and that's why I have pow(0., 0.) returning NaN with EDOM.
> But on looking a bit deeper into the draft standard for C9x (not
> 'the law' yet, but it's going to be), I find in Annex F.9.4.4:
>
> F.9.4.4 The pow functions
>
> [#1]
>
> -- pow(x, ±0) returns 1 for any x, even a NaN.
>
> Unlike some other Annexes, this one is 'normative', not just 'informative'
> stuff. This implies that pow(0,0)==1, by word of the (coming) standard.
(Sigh.) I (and several others) expressed reservations to Annex F in formal public
comments on the committee draft. Some suggestions were accepted, but Annex F still
specifies return values that (in my opinion) are mathematically indefensible. For
instance, atan2(INF,INF) is specified to return +/- PI/4 or +/- 3*PI/4, depending on
the signs of the infinities. This behavior is tantamount to agreeing that INF/INF =
+/- 1. Also, pow(-2., INF) returns INF, based on the reasoning that infinity is an
even integer.
In my library, I followed the dictates of classical mathematics and C90. If the
present Annex F survives in the C9x standard, I don't know what I'll do.
-Eric Rudd
- Raw text -