what is equivalent to negative infinity in java?−∞
Asked
Active
Viewed 191 times
1
-
possible duplicate of [Correct Way to Obtain The Most Negative Double](http://stackoverflow.com/questions/2389613/correct-way-to-obtain-the-most-negative-double) – kennytm Jun 05 '10 at 18:31
-
4@KennyTM The largest representable number and infinity are not equivalent. – Dana the Sane Jun 05 '10 at 18:42
3 Answers
2
Are you looking for Double.NEGATIVE_INFINITY ?
0
For the primitive integral types, there are Long.MIN_VALUE
, Integer.MIN_VALUE
, and Byte.MIN_VALUE
, . For double and float, it's a little more complicated. The smallest "real" values are Double.MIN_VALUE
and Float.MIN_VALUE
, respectively. However, there are also Double.NEGATIVE_INFINITY
and Float.NEGATIVE_INFINITY
.

Matthew Flaschen
- 278,309
- 50
- 514
- 539
-
No, `Double.MIN_NORMAL` is the smallest normal value. There are even smaller "subnormal values", `Double.MIN_VALUE`. – kennytm Jun 05 '10 at 18:40