issue 7006 - std.math.pow (integral, integral) crashes on negative exponents
NaN
divide at by.zero
Tue Dec 17 13:15:17 UTC 2019
On Sunday, 15 December 2019 at 18:31:14 UTC, Timon Gehr wrote:
> On 15.12.19 19:22, berni44 wrote:
>>
>> What do you think about this?
>>
>> [1] https://issues.dlang.org/show_bug.cgi?id=7006
>
> A negative exponent should behave like a negative exponent.
> I.e., a^^-1 = 1/a. There's no good reason to do anything else.
+1
There's no grey area IMO. Mathematically pow is defined for
negative exponents, even if almost all the time the result would
be truncated to zero when computing an integer result, that's
what it should do.
More information about the Digitalmars-d
mailing list