Description Of BigInteger: not()
The java.math.BigInteger.not() returns a BigInteger whose value is (~this) . (This method returns a negative value if and only if this BigInteger is non-negative)BigInteger.nextProbablePrime() method returns ~this
Code Example Java BigInteger
import java.math.BigInteger; public class BigIntegerExam { public static void main(String[] args) { BigInteger bi1 = new BigInteger("6"); BigInteger bi2 = new BigInteger("-6"); System.out.println(bi1.not()); // output -7 System.out.println(bi2.not()); // output 5 } }
ไม่มีความคิดเห็น :
แสดงความคิดเห็น