[Issue 7006] std.math.pow (integral, integral) crashes on negative exponents

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 20 16:44:34 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=7006

Cristian Creteanu <cristiancreteanu06 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cristiancreteanu06 at gmail.co
                   |                            |m

--- Comment #5 from Cristian Creteanu <cristiancreteanu06 at gmail.com> ---
I provided a fix for the issue. However, I noticed that the return type of the
function is an integer, which will make it impossible to have results different
from 0 or 1 for negative exponents (2 to -2 is 0.5, but pow will return 0; 1
will be returned for powers of 1, of course). I believe that pow, no matter the
arguments that are provided to it, should always return a floating point
number.

--


More information about the Digitalmars-d-bugs mailing list