1

what is equivalent to negative infinity in java?−∞

kennytm
  • 491,404
  • 99
  • 1,053
  • 989
dato datuashvili
  • 17,789
  • 59
  • 193
  • 310
  • 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 Answers3

6

Float.NEGATIVE_INFINITY and Double.NEGATIVE_INFINITY.

Jouni K. Seppänen
  • 40,105
  • 5
  • 71
  • 99
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
  • 268,153
  • 48
  • 509
  • 534
  • 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