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

What is Java math BigInteger doubleValue() Method?

Description

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.

Declaration

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

Specified by

Double Value in class Number.

Parameters

NA

Return Value

This technique returns this BigInteger converted to a double.

Exception

NA

Example

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 © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Java.math Package Topics