So I found this using 2 to the power of >= 31

bearophile bearophileHUGS at lycos.com
Wed Jun 12 19:35:46 PDT 2013


Carlos:

> What do I have to know about how D works with data ?

If you want to avoid the overflow, then use a BigInt from 
std.bigint:

import std.stdio, std.bigint;

void main() {
     foreach (immutable i; 0 .. 100)
         writeln(i, " ", 2.BigInt ^^ i);
}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list