Skip to content

Tag Archives: Java-math-package

GCD (Greatest Common Divisor) or HCF (Highest Common Factor) of two numbers is the largest number that divides both of them. The java.math.BigInteger.gcd(BigInteger val) method… Read More
The java.math.BigDecimal.pow(int n) method is used to calculate a BigDecimal raise to the power of some other positive number passed as parameter (this)n. This method… Read More
The java.math.BigInteger.isProbablePrime(int certainty) method is used to tell if this BigInteger is probably prime or if it’s definitely composite. This method checks for prime or… Read More
java.math.BigInteger.sqrt() is an inbuilt function added in Java SE 9 & JDK 9 which returns BigInteger value of square root of a BigInteger on which… Read More
java.math.BigInteger.divideAndRemainder(BigInteger val) was introduced in Java 8. This method returns an array of two BigInteger after applying division operation between the BigInteger calling this method… Read More
java.math.BigInteger.shortValueExact() was introduced in Java 8. It is an inbuilt function which converts the value of BigInteger to a short and checks for lost information.… Read More
java.math.BigInteger.intValueExact() was introduced in Java 8. It is an inbuilt function which converts the value of BigInteger to a int and checks for lost information.… Read More
java.math.BigInteger.byteValueExact() was introduced in Java 8. It is an inbuilt function which converts the value of BigInteger to a byte and checks for any lost… Read More
java.math.BigInteger.longValueExact() was introduced in Java 8. It is an inbuilt function which converts the value of BigInteger to a long and checks for lost information.… Read More
BigInteger Class offers 2 methods for toString(). toString(int radix): The java.math.BigInteger.toString(int radix) method returns the decimal String representation of this BigInteger in given radix. Radix… Read More
The java.math.BigInteger.toByteArray() method returns a array of byte containing the two’s-complement representation of this BigInteger. The most significant byte of byte array is present in… Read More
The java.math.BigInteger.mod(BigInteger big) method returns a BigInteger whose value is equal to (this BigInteger modfunction big(BigInteger passed as parameter)).In other words we can say that… Read More
The java.math.BigInteger.valueOf(long value) method returns a BigInteger whose value is equal to value of long passed as parameter. This method is static method so It… Read More
The java.math.BigInteger.doubleValue() converts this BigInteger to a double value. If the value return by this function is too big for a magnitude to represent as… Read More
The java.math.BigInteger.equals(Object x) method compares this BigInteger with the object passed as the parameter and returns true in both are equal in value else it… Read More

Start Your Coding Journey Now!