Created
August 16, 2009 10:33
-
-
Save oksoftware/168599 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fibonacci; | |
import java.math.*; | |
public class Fibonacci { | |
public static void main(String[] args) { | |
BigInteger a, b, tmp; | |
a = new BigInteger("0"); | |
b = new BigInteger("1"); | |
while(true){ | |
System.out.println(a.toString()); | |
tmp = b; | |
b = b.add(a); | |
a = tmp; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment