Java.math.BigInteger Class Java.math.BigInteger.doubleValue() Method - Java.math Package

What is Java math BigInteger doubleValue() Method?


The java.math.BigInteger.doubleValue() converts this BigInteger to a double. This conversion is similar to the narrowing primitive conversion from double to flow.

If this BigInteger has too incredible a importance to represent as a double, it will be transformed to Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY as appropriate. even when the return value is finite, this conversion can lose records about the precision of the BigInteger value.


Following is the declaration for java.math.BigInteger.doubleValue() technique.

Specified by

Double Value in class Number.



Return Value

This technique returns this BigInteger converted to a double.




The following example shows the usage of math.BigInteger.doubleValue()technique.

Let us compile and run the above program, this will produce the following result −

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Java.math Package Topics