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

jmh530 john.michael.hall at gmail.com
Mon Dec 16 15:33:33 UTC 2019


On Monday, 16 December 2019 at 15:13:44 UTC, jmh530 wrote:
> [snip]
>
> What I mean is that if i is 0.5, then you have to return a 
> complex. So you have to add a special case for that.

Simple work-around for the (-1)^^i:

import std;

void main() {
     auto x = iota(10).map!(a => a % 2 ? 1 : -1);
}



More information about the Digitalmars-d mailing list