Mail Archives: djgpp/1998/04/29/08:49:31
Message-ID: | <D1FB30BBA491D1118E6D006097BCAE392F174C@Probe-nt-2a.Probe.co.uk>
|
From: | Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
|
To: | djgpp AT delorie DOT com
|
Subject: | Re: Problems with paranoia.c and pow(0,0)
|
Date: | Wed, 29 Apr 1998 13:48:47 +0100
|
MIME-Version: | 1.0
|
Alex writes:
> but later I discovered the pow(0,0) is not number that is
> uncountable. Try it on a calculator You will see!
>
> So, don't want to try to compute it. This a math rule as I
> discovered.
Absolutely. I don't know exactly what the ANSI standard states should
be the result from this calculation, but when you think about it in
mathematical terms, it is obvious that there can be no single
'correct' result. Given the two numerical truisms:
n^0 = 1
0^n = 0
you can see that there is a conflict for the special case 0^0. Since
there is no clear definition of what this calculation should produce,
it seems reasonable for a library implementation to return NaN.
Shawn Hargreaves.
- Raw text -