This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_cpow((0,0),(0,0))
dewar@adacore.com (Robert Dewar) wrote on 07.03.05 in <422CFBA7.8080001@adacore.com>:
> Ronny Peine wrote:
>
> > Sorry for this, maybe i should sleep :) (It's 2 o'clock here)
> > But as i know of 0^0 is defined as 1 in every lecture i had so far.
>
> Were these math classes, or CS classes.
Let's just say that this didn't happen in any of the German math classes I
ever took, school or uni. This is in fact a classic example of this type
of behaviour.
> Generally when you have a situation like this, where the value of
> the function is different depending on how you approach the limit,
> you prefer to simply say that the function is undefined at that
> point.
And that's how it was always taught to me.
This is, of course, a different question from what a library should
implement ... though I must say if I were interested in NaNs at all for a
given problem, I'd be disappointed by any such library that didn't return
a NaN for 0^0, and of any language standard saying so - I'd certainly
consider a result of 1 wrong in the general case.
MfG Kai
- References:
- __builtin_cpow((0,0),(0,0))
- Re: __builtin_cpow((0,0),(0,0))
- Re: __builtin_cpow((0,0),(0,0))
- Re: __builtin_cpow((0,0),(0,0))