Re: RFR: 8271225: Add floorDivExact() method to java.lang.[Strict]Math [v3]

2021-08-30 Thread Joe Darcy
On Thu, 5 Aug 2021 18:57:42 GMT, Brian Burkhalter  wrote:

>> Add methods `floorDivExact(int,int)` and `floorDivExact(long,long)` to 
>> `java.lang.Math` and `java.lang.StrictMath`.
>
> Brian Burkhalter has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains five commits:
> 
>  - 8271225: Verbiage update after 8271599
>  - Merge
>  - 8271225: Revert drive-by verbiage updates
>  - 8271225: Some verbiage updates
>  - 8271225: Add floorDivExact() method to java.lang.[Strict]Math

Marked as reviewed by darcy (Reviewer).

-

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


Re: RFR: 8271225: Add floorDivExact() method to java.lang.[Strict]Math [v3]

2021-08-19 Thread Brian Burkhalter
On Thu, 5 Aug 2021 18:57:42 GMT, Brian Burkhalter  wrote:

>> Add methods `floorDivExact(int,int)` and `floorDivExact(long,long)` to 
>> `java.lang.Math` and `java.lang.StrictMath`.
>
> Brian Burkhalter has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains five commits:
> 
>  - 8271225: Verbiage update after 8271599
>  - Merge
>  - 8271225: Revert drive-by verbiage updates
>  - 8271225: Some verbiage updates
>  - 8271225: Add floorDivExact() method to java.lang.[Strict]Math

The CSR for this PR has been approved.

-

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


Re: RFR: 8271225: Add floorDivExact() method to java.lang.[Strict]Math [v3]

2021-08-05 Thread Brian Burkhalter
On Thu, 5 Aug 2021 18:57:42 GMT, Brian Burkhalter  wrote:

>> Add methods `floorDivExact(int,int)` and `floorDivExact(long,long)` to 
>> `java.lang.Math` and `java.lang.StrictMath`.
>
> Brian Burkhalter has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains five commits:
> 
>  - 8271225: Verbiage update after 8271599
>  - Merge
>  - 8271225: Revert drive-by verbiage updates
>  - 8271225: Some verbiage updates
>  - 8271225: Add floorDivExact() method to java.lang.[Strict]Math

CSR updated to match this PR.

-

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


Re: RFR: 8271225: Add floorDivExact() method to java.lang.[Strict]Math [v3]

2021-08-05 Thread Brian Burkhalter
> Add methods `floorDivExact(int,int)` and `floorDivExact(long,long)` to 
> `java.lang.Math` and `java.lang.StrictMath`.

Brian Burkhalter has updated the pull request with a new target base due to a 
merge or a rebase. The pull request now contains five commits:

 - 8271225: Verbiage update after 8271599
 - Merge
 - 8271225: Revert drive-by verbiage updates
 - 8271225: Some verbiage updates
 - 8271225: Add floorDivExact() method to java.lang.[Strict]Math

-

Changes: https://git.openjdk.java.net/jdk/pull/4941/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=4941=02
  Stats: 205 lines in 3 files changed: 202 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4941.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4941/head:pull/4941

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


Re: RFR: 8271225: Add floorDivExact() method to java.lang.[Strict]Math

2021-08-03 Thread Brian Burkhalter
On Tue, 3 Aug 2021 08:42:18 GMT, Raffaello Giulietti 
 wrote:

>> The `floorDivExact()` methods are identical to their `floorDiv()` 
>> counterparts aside from that they throw an `ArithmeticException` when the 
>> dividend is `MIN_VALUE` and the divisor is `-1`. These methods behave with 
>> respect to the methods `floorDiv()` as the methods `divideExact()` behave 
>> with respect to the division operator `/`.
>
> Hello @bplb,
> 
> the doc of floorDivExact() is not, well..., exact.
> 
> For example,
>> The floor rounding mode gives different results from truncation
> when the exact result is negative.
> 
> The truth is that the results are different when the exact quotient _is not 
> an integer and is negative_.
> The description following this sentence is imprecise as well.
> 
> The doc seems to have been copied and adapted from the doc of floorDiv(), 
> which is imprecise in the first place.
> You might want to take a look at [PR 
> 4963](https://github.com/openjdk/jdk/pull/4963) which addresses this and wait 
> until that one is thoroughly discussed for mathematical accuracy and correct 
> wording.
> 
> 
> Greetings
> Raffaello

@rgiulietti Yes, that doc was copied. I tend to agree that it would be better 
to get 4963 right and hold off on this PR until then.

-

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


Re: RFR: 8271225: Add floorDivExact() method to java.lang.[Strict]Math

2021-08-03 Thread Raffaello Giulietti
On Thu, 29 Jul 2021 23:28:07 GMT, Brian Burkhalter  wrote:

>> Add methods `floorDivExact(int,int)` and `floorDivExact(long,long)` to 
>> `java.lang.Math` and `java.lang.StrictMath`.
>
> The `floorDivExact()` methods are identical to their `floorDiv()` 
> counterparts aside from that they throw an `ArithmeticException` when the 
> dividend is `MIN_VALUE` and the divisor is `-1`. These methods behave with 
> respect to the methods `floorDiv()` as the methods `divideExact()` behave 
> with respect to the division operator `/`.

Hello @bplb,

the doc of floorDivExact() is not, well..., exact.

For example,
> The floor rounding mode gives different results from truncation
when the exact result is negative.

The truth is that the results are different when the exact quotient _is not an 
integer and is negative_.
The description following this sentence is imprecise as well.

The doc seems to have been copied and adapted from the doc of floorDiv(), which 
is imprecise in the first place.
You might want to take a look at [PR 
4963](https://github.com/openjdk/jdk/pull/4963) which addresses this and wait 
until that one is thoroughly discussed for mathematical accuracy and correct 
wording.


Greetings
Raffaello

-

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


Re: RFR: 8271225: Add floorDivExact() method to java.lang.[Strict]Math [v2]

2021-08-02 Thread Brian Burkhalter
> Add methods `floorDivExact(int,int)` and `floorDivExact(long,long)` to 
> `java.lang.Math` and `java.lang.StrictMath`.

Brian Burkhalter has updated the pull request incrementally with one additional 
commit since the last revision:

  8271225: Some verbiage updates

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4941/files
  - new: https://git.openjdk.java.net/jdk/pull/4941/files/03e83cda..7601fe9b

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=4941=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=4941=00-01

  Stats: 20 lines in 2 files changed: 0 ins; 0 del; 20 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4941.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4941/head:pull/4941

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


RFR: 8271225: Add floorDivExact() method to java.lang.[Strict]Math

2021-07-29 Thread Brian Burkhalter
Add methods `floorDivExact(int,int)` and `floorDivExact(long,long)` to 
`java.lang.Math` and `java.lang.StrictMath`.

-

Commit messages:
 - 8271225: Add floorDivExact() method to java.lang.[Strict]Math

Changes: https://git.openjdk.java.net/jdk/pull/4941/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=4941=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8271225
  Stats: 245 lines in 3 files changed: 236 ins; 0 del; 9 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4941.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4941/head:pull/4941

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


Re: RFR: 8271225: Add floorDivExact() method to java.lang.[Strict]Math

2021-07-29 Thread Brian Burkhalter
On Thu, 29 Jul 2021 23:27:32 GMT, Brian Burkhalter  wrote:

> Add methods `floorDivExact(int,int)` and `floorDivExact(long,long)` to 
> `java.lang.Math` and `java.lang.StrictMath`.

The `floorDivExact()` methods are identical to their `floorDiv()` counterparts 
aside from that they throw an `ArithmeticException` when the dividend is 
`MIN_VALUE` and the divisor is `-1`. These methods behave with respect to the 
methods `floorDiv()` as the methods `divideExact()` behave with respect to the 
division operator `/`.

-

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