Created
May 24, 2013 20:22
-
-
Save bchetty/5646256 to your computer and use it in GitHub Desktop.
Looping through a range of BigInteger values.
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
| import java.math.BigInteger; | |
| public class BigIntTest { | |
| public static void main(String[] args) { | |
| BigInteger bigInt1 = new BigInteger("1000000000000000"); | |
| BigInteger bigInt2 = new BigInteger("1000000000000500"); | |
| //Loop from bigInt1 to bigInt2 | |
| for(BigInteger bigInt = bigInt1; bigInt.compareTo(bigInt2) < 0; bigInt = bigInt.add(BigInteger.ONE)) { | |
| System.out.println("I'm so big now : " + bigInt); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment