forked from ChrisMayfield/ThinkJavaCode2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBigInt.java
More file actions
20 lines (15 loc) · 435 Bytes
/
BigInt.java
File metadata and controls
20 lines (15 loc) · 435 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.math.BigInteger;
/**
* BigInteger examples.
*/
public class BigInt {
public static void main(String[] args) {
long x = 17;
BigInteger big = BigInteger.valueOf(x);
String s = "12345678901234567890";
BigInteger bigger = new BigInteger(s);
BigInteger a = BigInteger.valueOf(17);
BigInteger b = BigInteger.valueOf(1700000000);
BigInteger c = a.add(b);
}
}