Skip to content

Instantly share code, notes, and snippets.

@porcelli
Created July 10, 2011 01:24
Show Gist options
  • Save porcelli/1074131 to your computer and use it in GitHub Desktop.
Save porcelli/1074131 to your computer and use it in GitHub Desktop.
public static void main(String... args) {
StopWatch sw = new StopWatch();
sw.start();
BigInteger a = new BigInteger("0");
BigInteger b = new BigInteger("1");
for (int i = 0; i < 1e6; i++) {
final BigInteger c = b;
b = a.add(b);
a = c;
}
sw.stop();
System.out.println(b);
System.out.println(sw.toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment