Reviewer needed: 6282196 There should be Math.mod(number, modulo) methods (original) (raw)

Roger Riggs Roger.Riggs at oracle.com
Mon Apr 16 21:08:59 UTC 2012


Hi,

I've corrected a number of issues raised with javadoc in java.lang.Math and java.lang.StrictMath. The updated webrev is: http://cr.openjdk.java.net/~rriggs/6282196.2/

Please review.

Thanks, Roger

On 03/05/2012 08:38 AM, Roger Riggs wrote:

CR 6282196 There should be Math.mod(number, modulo) methods http://bugs.sun.com/bugdatabase/viewbug.do?bugid=6282196

Requests that floor and modulus methods be provided for primitive types. Floor division is pretty straight-forward, rounding toward minus infinity. For modulus of int and long, the sign and range follow the exiting floor method in java.util.Math and satisfy the relation that mod(x, y) = (x - floorDiv(x, y) * y).



More information about the core-libs-dev mailing list