- import java.math.BigDecimal;
- import java.math.BigInteger;
- public class Ch01 {
- Ch01()
- {
- BigInteger a=new BigInteger("45000000000000000000000000000000000000000");
- BigInteger b=new BigInteger("4567683213245657895453612354679545666666666665555553");
- BigInteger c=new BigInteger("55000000000000000000000000000000000000000");
-
- long x=12000000000l;
- long y=53000000000l;
-
- System.out.println(x+y);
- System.out.println(a.add(b));
- System.out.println(a.subtract(b));
- System.out.println(a.multiply(b));
- System.out.println(a.divide(b));
- System.out.println(a.remainder(b));
- System.out.println(a.gcd(b));
- System.out.println(a.pow(20));
- }
- public static void main(String[] args) {
- new Ch01();
- }
- }
複製代碼 |