RFR: 8261862: Expand discussion of rationale for BigDecimal equals/compareTo semantics [v2]

Joe Darcy darcy at openjdk.java.net
Wed Mar 3 19:33:16 UTC 2021


On Wed, 3 Mar 2021 18:19:33 GMT, Stuart Marks <smarks at openjdk.org> wrote:

>> Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Respond to review feedback and reflow paragraphs.
>>  - Merge branch 'master' into 8261862
>>  - 8261862: Expand discussion of rationale for BigDecimal equals/compareTo semantics
>
> src/java.base/share/classes/java/math/BigDecimal.java line 3155:
> 
>> 3153:      * {@code new BigDecimal("2.00").divide(BigDecimal.valueOf(3),
>> 3154:      * HALF_UP)} which evaluates to 0.<b>6</b>7.
>> 3155:      *
> 
> Should this be in an `@apiNote`?
> 
> I'm not sure adding the boldface 0.**6**7 is helpful; 0.7 is self-evidently unequal to 0.67.

Changed as suggested in final version.

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

PR: https://git.openjdk.java.net/jdk/pull/2804


More information about the core-libs-dev mailing list