Skip to content

Instantly share code, notes, and snippets.

@olaugh
Created August 6, 2012 18:59
Show Gist options
  • Save olaugh/3277561 to your computer and use it in GitHub Desktop.
Save olaugh/3277561 to your computer and use it in GitHub Desktop.
dlang bignum example
import std.bigint;
import std.stdio;
BigInt bigPow(BigInt x, int n) {
BigInt answer = 1;
for (auto i = 0; i < n; i++) {
answer *= x;
}
return answer;
}
void main() {
writefln("2^1000: %s", bigPow(cast(BigInt)2, 1000));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment