Please rid me of this goto
Ola Fosheim Grøstad via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jun 24 09:38:54 PDT 2016
On Friday, 24 June 2016 at 15:17:52 UTC, Ola Fosheim Grøstad
wrote:
> On Friday, 24 June 2016 at 13:51:33 UTC, Andrei Alexandrescu
> wrote:
>> On 06/24/2016 02:58 AM, Martin Tschierschke wrote:
>>> Second: Just look at Wikipedia and take the IEEE floating
>>> point standard:
>>> https://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_power_of_zero
>>
>> Scrolling down, I see how IEEE prescribes pown(0, 0) to return
>> 1. I guess that's a good practical argument. -- Andrei
>
> Nope, pown requires an exact integer, powr(0.0,0.0) yields NaN.
Actually, the wikipedia article was wrong.
powr(0.0,y) and y<0 => exception
powr(x,y) and x<0 => exception
powr(0.0,0.0) => exception
powr(Inf,0.0) => exception
powr(1,Inf) => exception
powr(x,qNaN) => qNaN
pwor(qNaN,y) => qNaN
Much more sane than pow(x,y)...
More information about the Digitalmars-d
mailing list