On Wednesday, 21 March 2018 at 16:00:56 UTC, Adam D. Ruppe wrote:
On Wednesday, 21 March 2018 at 15:56:00 UTC, aerto wrote:
why pow(256, 27) gives 0, instead of 105312291668557186697918027683670432318895095400549111254310977536L

that result is simply too big to fit in the result. Try using a bigint instead:

import std.bigint, std.stdio;

void main() {
        BigInt i = 256;
        i ^^= 27;
        writeln(i);
}

thanks, a last question in a diffrent function i use writeln(105312291668557186697918027683670432318895095400549111254310977536L); and i get Error: integer overflow any solution >?



  • pow aerto via Digitalmars-d
    • Re: pow Adam D. Ruppe via Digitalmars-d
      • Re: pow aerto via Digitalmars-d
        • Re: pow Adam D. Ruppe via Digitalmars-d
    • Re: pow H. S. Teoh via Digitalmars-d

Reply via email to