RFR of 8023217: Additional floorDiv/floorMod/multiplyExact methods for java.lang.Math
brian.burkhalter at oracle.com
Wed Sep 30 00:49:34 UTC 2015
I revised floorMod(long x, int y) not to check explicitly check for integer overflow as it does not look as if this is even possible. I also updated the appropriate tests for these versions of the three methods at issue.
In testing I still found discrepancies between the existing implementations and the ones suggested earlier in this thread. Therefore those implementations have not been used. If it is desired to move to different implementations at a later date a separate enhancement issue may be filed.
The updated webrev is here:
On Sep 29, 2015, at 8:16 AM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
> On Sep 29, 2015, at 8:05 AM, Stephen Colebourne <scolebourne at joda.org> wrote:
>>> I tested the code which was in the original issue description and found some
>>> discrepancies. I’ll need to revisit this to see what happened.
>> Yes, the code in the issue for floorDiv() fails when the divisor is
>> negative. The one in my email today works though.
> Excellent! I’ll double check it as part of the “fit and finish."
More information about the core-libs-dev