Why is Double.MIN_VALUE in not negative

Viewed 111954

Can anyone shed some light on why Double.MIN_VALUE is not actually the minimum value that Doubles can take? It is a positive value, and a Double can of course be negative.

I understand why it's a useful number, but it seems a very unintuitive name, especially when compared to Integer.MIN_VALUE. Calling it Double.SMALLEST_POSITIVE or MIN_INCREMENT or similar would have clearer semantics.

Also, what is the minimum value that Doubles can take? Is it -Double.MAX_VALUE? The docs don't seem to say.

6 Answers

I assume the confusing names can be traced back to C, which defined FLT_MIN as the smallest positive number.

Like in Java, where you have to use -Double.MAX_VALUE, you have to use -FLT_MAX to get the smallest float in C.

Related