Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact
Version 2 (modified by jpelcis, 18 years ago)
Fixed a formatting error

Python Challenge -- Level 0 -- Native Solution

Code

import tango.io.Stdout;

void main () {
        Stdout.print(1L << 38);
}

Explanation

        Stdout.print(1L << 38);

Shift the number 1 to the right 38 binary digits. The L is necessary because the default size of an integer is ptrdiff_t, which is 32-bits on a 32-bit platform. Shifting 38 digits to the right would overflow it. The result is printed to the screen.