What is the biggest integer value can be represented by double in Java? And what is the biggest value can be represented with the maximum digits after the point? Is it depends number of digits before point on maximum number of digits after the point? There are two fields in the class Double: MAX_VALUE and MIN_VALUE. What is the MAX_VALUE sense?
Asked
Active
Viewed 8,816 times
0
-
2What do you think `MAX_VALUE` could possibly mean? Perhaps, it is the character used to represent the decimal point? โ Dima Dec 25 '14 at 14:21
-
What do you mean by "maximum digits after the point"? e.g. If the number is zero, you can have infinitely many zeros after the point (0.00000000000000000000000...). โ DNA Dec 25 '14 at 14:24
-
A floating point number consists of bits for sign, exponent and mantisse (digits in binary). So MAX_VALUE is something like (base 2) `0.11111111 * 2^11111`. In general be aware of the many short-comings and where to use the (ugly verbose) BigDecimal. [`Math.nextUp(double)`](http://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#nextUp-double-) will give the adjacent double which might be more than 1 apart. โ Joop Eggen Dec 25 '14 at 14:34
1 Answers
3
The biggest integer value represented by double is : 2^53 , for details look here.
And the biggest value can be represented with max digits after the point depends on the number itself, but the max number of digits (for example when representing
0.1
) is0.1000000000000000055511151231257827021181583404541015625
have a look at this answer.And the MAX_VALUE represents : (2-2^-52)ยท2^1023 (have a look at min and max values at this answer)

Community
- 1
- 1

Muhammed Refaat
- 8,914
- 14
- 83
- 118