BigInteger: doubleValue() : BigInteger « java.math « Java by API






BigInteger: doubleValue()

   
import java.math.BigInteger;

/*
Here's Long.MAX_VALUE: 9223372036854775807
Here's a bigger number: 3419229223372036854775807
Here it is as a double: 3.419229223372037E24
 */
public class MainClass {
  public static void main(String[] args) {
    System.out.println("Here's Long.MAX_VALUE: " + Long.MAX_VALUE);
    BigInteger bInt = new BigInteger("3419229223372036854775807");
    System.out.println("Here's a bigger number: " + bInt);
    System.out.println("Here it is as a double: " + bInt.doubleValue());
  }

}

           
         
    
    
  








Related examples in the same category

1.BigInteger.TEN
2.new BigInteger(byte[] val)
3.new BigInteger(String val)
4.new BigInteger(String val, int radix)
5.new BigInteger(int bitLength, int certainty, Random rnd)
6.BigInteger: add(BigInteger val)
7.BigInteger: andNot(BigInteger val)
8.BigInteger: bitLength()
9.BigInteger: clearBit(int n)
10.BigInteger: divide(BigInteger val)
11.BigInteger: flipBit(int n)
12.BigInteger: isProbablePrime(int certainty)
13.BigInteger: modPow(BigInteger exponent, BigInteger m)
14.BigInteger: multiply(BigInteger val)
15.BigInteger: negate()
16.BigInteger: not()
17.BigInteger: or(BigInteger val)
18.BigInteger: probablePrime(int bitLength, Random rnd)
19.BigInteger: pow(int exponent)
20.BigInteger: setBit(int n)
21.BigInteger: shiftLeft(int n)
22.BigInteger: shiftRight(int n)
23.BigInteger: subtract(BigInteger val)
24.BigInteger: testBit(int n)
25.BigInteger: toByteArray()
26.BigInteger: toString()
27.BigInteger: toString(int radix)
28.BigInteger: valueOf(long val)
29.BigInteger: xor(BigInteger val)