2075 / Java / Типи даних / BigInteger
BigInteger a = BigInteger.valueOf(1); // long -> BigInteger BigInteger b = BigInteger.valueOf(5); // long -> BigInteger // +, -, *, /, >, <, ==, != не працює a = a.add(b); // 6 a = a.subtract(BigInteger.valueOf(2)); // 4 a = a.divide(BigInteger.valueOf(2)); // 2 a = a.multiply(BigInteger.valueOf(3)); // 6 a = a.mod(BigInteger.valueOf(4)); // 2 a = BigInteger.valueOf(9); // 9 a = a.sqrt(); // 3 if (a.compareTo(b) == 0) { } // a == b = 0, a < b = -1, a > b = 1 int x = a.intValue(); // 3 byteValue(), shortValue(), longValue()