[Issue 7006] std.math.pow (integral, integral) crashes on negative exponents
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Dec 15 11:13:39 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=7006
berni44 <bugzilla at d-ecke.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |bugzilla at d-ecke.de
Resolution|--- |WONTFIX
--- Comment #6 from berni44 <bugzilla at d-ecke.de> ---
(In reply to Cristian Creteanu from comment #5)
> I believe that
> pow, no matter the arguments that are provided to it, should always return a
> floating point number.
That would mean pow(4294967290UL,2) == 18446744022169944064 instead of the
correct 18446744022169944100...
If you really need negative powers of integeres, you should cast to floating
point before using pow.
--
More information about the Digitalmars-d-bugs
mailing list