RFR: JDK-8257086: Clarify differences between {Float, Double}.equals and ==
Brian Burkhalter
bpb at openjdk.java.net
Tue Dec 8 17:14:11 UTC 2020
On Tue, 8 Dec 2020 16:29:49 GMT, Joe Darcy <darcy at openjdk.org> wrote:
> Updates to the specifications of Double.{equals, compareTo} to explain more explicitly why the obvious wrappers around "==" and "<"/"==" are not sufficient for floating-point values.
>
> Once the wording is worked out, I'll replicate it for the analogous methods on Float.
src/java.base/share/classes/java/lang/Double.java line 811:
> 809: *
> 810: * <p>also has the value {@code true}. However, there are two
> 811: * exceptions where the properties of an equivalence relations are
type: relations -> relation.
src/java.base/share/classes/java/lang/Double.java line 1008:
> 1006: * This method imposes a total order on {@code Double} objects
> 1007: * with two differences compared to the incomplete order defined the
> 1008: * by Java language numerical comparison operators ({@code <, <=,
Typo: defined the by Java -> defined by the Java.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1699
More information about the core-libs-dev
mailing list