RFR: JDK-8294539: Augment discussion of equivalence relations on floating-point values [v2]

Paul Sandoz psandoz at openjdk.org
Fri Sep 30 20:25:49 UTC 2022


On Fri, 30 Sep 2022 17:24:40 GMT, Joe Darcy <darcy at openjdk.org> wrote:

>> While the floating-point == operation is *not* an equivalence relation, there are useful equivalence relations that can be defined over floating-point values. Text is added to java.lang.Double to discuss and name those relations.
>
> Joe Darcy has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Add discussion of numerical equality.
>  - Fix typo.

Marked as reviewed by psandoz (Reviewer).

src/java.base/share/classes/java/lang/Double.java line 166:

> 164:  * equivalence relation for {@code double} values {@code a} and {@code b} is
> 165:  * implemented by the expression
> 166:  * <br>{@code Double.doubleTo}<code><b>Raw</b></code>{@code LongBits(a) == Double.doubleTo}<code><b>Raw</b></code>{@code LongBits(b)}<br>

Place in a code snippet since it's hard to read in source otherwise? Snippets allow for highlighting e.g.

/**
 * {@snippet :
 * Double.doubleToRawLongBits(a) == Double.doubleToRawLongBits(b) // @highlight substring="Raw"
 * }
 */

-------------

PR: https://git.openjdk.org/jdk/pull/10498


More information about the core-libs-dev mailing list