<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hmm. I understand the motivation here and the asymmetry with the
integral types, but on the whole I don't think deprecating {Float,
Double}.MIN_VALUE and recommending use of a differently-named
field with the same value would be a net improvement.<br>
</p>
<p>-Joe<br>
</p>
<div class="moz-cite-prefix">On 12/2/2024 3:17 PM, Éamonn McManus
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAChqX8-QmtBVQA3ZW3pHMSRxep0SsuTK_PR+1MB7D0GUt2QFgQ@mail.gmail.com">
<div dir="ltr">At Google, we've had several issues over the years
relating to Double.MIN_VALUE. People have not unreasonably
supposed that Double.MIN_VALUE has the same relationship to
Double.MAX_VALUE as Integer.MIN_VALUE has to Integer.MAX_VALUE.
So they think that Double.MIN_VALUE is the (finite) negative
number of largest magnitude, rather than the positive number of
smallest magnitude. We're currently thinking of adding a
constant MIN_POSITIVE_VALUE to Guava's <a href="https://guava.dev/releases/snapshot-jre/api/docs/com/google/common/primitives/Doubles.html" moz-do-not-send="true">Doubles</a> class and having static
analysis that suggests using that instead of Double.MIN_VALUE,
if that is indeed what you meant, or of course using
-Double.MAX_VALUE if *that* is what you meant.
<div><br>
</div>
<div>A few JDK and JavaFX bugs show that Google engineers are
not the only ones to be confused by this:</div>
<div><a href="https://bugs.openjdk.org/browse/JDK-4218647" moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.openjdk.org/browse/JDK-4218647</a></div>
<div><a href="https://bugs.openjdk.org/browse/JDK-8092698" moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.openjdk.org/browse/JDK-8092698</a></div>
<div><a href="https://bugs.openjdk.org/browse/JDK-8156186" moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.openjdk.org/browse/JDK-8156186</a></div>
<div><br>
</div>
<div>So we also wonder if it would make sense to deprecate
Double.MIN_VALUE itself and introduce
Double.MIN_POSITIVE_VALUE with the same meaning. Obviously the
same thing would apply to Float.</div>
</div>
</blockquote>
</body>
</html>