issue 7006 - std.math.pow (integral, integral) crashes on negative exponents

mipri mipri at minimaltype.com
Mon Dec 16 01:18:49 UTC 2019


On Monday, 16 December 2019 at 00:51:55 UTC, Guillaume Piolat 
wrote:
> On Sunday, 15 December 2019 at 18:22:28 UTC, berni44 wrote:
>>
>> What do you think about this?
>>
>
> That to desire a result is such useless it's probably 
> indicative of a logic error aka bug. Or the user expected a FP 
> return type and as such it should crash and warn the user.

It can be "probably a logical error" for subtraction to return
a negative result. It can be "probably a logic error" for
integer division to have a remainder. Mathematical functions
should do as they're told and let the caller sort out what
meaning a calculation has.


More information about the Digitalmars-d mailing list