On Sun, 7 May 2023 17:58:26 GMT, Roger Riggs <rri...@openjdk.org> wrote:

>> The implementation of java.time.Instant.until(I2, ChronoUnit) in some cases 
>> did not correctly borrow or carry from the nanos to the seconds when 
>> computing using ChronoUnit.MILLIS or ChronoUnit.MICROS.
>> The errant computation was introduced by 
>> [JDK-8273369](https://bugs.openjdk.org/browse/JDK-8273369).
>
> Roger Riggs has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Slight perf improvement using int instead of long for local nanosDiff

I think that the explanation of the old code failing to properly consider 
carries and borrows, in the "Problem" section, is quite clear.

For the record, I added a more math-oriented comment.

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

PR Comment: https://git.openjdk.org/jdk/pull/13846#issuecomment-1538894644

Reply via email to