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

Carlos checoimg at gmail.com
Thu Jun 13 14:49:37 PDT 2013


On Thursday, 13 June 2013 at 02:41:46 UTC, bearophile wrote:
> 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

:D Great!


More information about the Digitalmars-d-learn mailing list