[Issue 1976] Integral pow does not accept negative powers

Max Samukha spambox at foo.com
Tue Apr 8 04:31:11 PDT 2008


Janice Caron Wrote:

> On 07/04/2008, d-bugmail at puremagic.com <d-bugmail at puremagic.com> wrote:
> >  How about pow called with an unsigned exponent larger than int.max?
> 
> Overload it for both int and uint, and have the int version accept
> negative values?

Yes, there is pow(real, int) in phobos that calls row(real, real) if the exponent is negative. Somehow the overload resolution error I got when calling pow with (double, int) made me think there is no such an overload. Anyway, though the proposed implementation may be faster for negative exponents, it doesn't work for int.min and so needs more thought.


More information about the Digitalmars-d-bugs mailing list