[ACCEPTED]-Correct Way to Obtain The Most Negative Double-java

Accepted answer
Score: 30

Assuming you mean the largest negative, non-infinite 6 number, sounds correct because, for floating 5 point numbers in 64-bit IEEE 754 floating point (which is what Java uses for doubles):

  • The size of the number is stored in one part of the binary rep
  • The sign of the number is stored in a separate part of the binary rep

Therefore: The 4 largest representable negative number would 3 be the same as the largest representable 2 positive number with the sign bit flipped 1 to indicate a negative number.

Score: 24

Nope, it's Double.NEGATIVE_INFINITY.


More Related questions