Mail Archives: djgpp-workers/1999/06/09/07:33:33
On Wed, 9 Jun 1999, Martin Stromberg wrote:
> Eric said:
>
> > In particular, though the prevailing consensus is that 0^0 should be defined
> > as 1, my decision to raise EDOM for pow(0., 0.) was based on the fact that
> > it is mathematically-indeterminate.
>
> Well, as lim(x^0) = 1, in one way it does make sense to define 0^0 = 1,
> x->0+
BUT: with exactly as much relevance, I could claim:
as lim(0^x) = 0, in one way it does make sense to define 0^0 = 0
Actually, from a mathematical point of view, it's even worse than that:
you can't just get two different results. You can get *every* result you
want. This is because, effectively x^y for non-integer x and y is
equivalent to exp(y * log(x)). By using the continuity of exp and log,
you get:
lim(x->0, y->0, exp(y * log(x)))
= exp( lim(x->0, y->0, y * log(x)) (z := log(x))
= exp( lim(z->-infinity, y->0, y * z)
"=" exp ( - 0 * infinity)
Now, zero times infinity is completely undefined, obviously. Its value is
totally dependant on *how*, exactly, y and z make their ways to zero and
-infinity (which can easily be seen from the Bernoulli-l'Hospital
theorem). Therefore, this limit cannot possibly exist, and 0^0 cannot
be given any single, well-defined value.
It is, however, rather often defined to be 1.0, by mathematicians,
whenever it suits their particular needs.
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.
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -