Re: Code review request: 6282196 There should be Math.mod(number, modulo) methods

2012-02-22 Thread Stephen Colebourne
Can you explain why the mod implementation differs from that in JSR-310? https://github.com/ThreeTen/threeten/blob/master/src/main/java/javax/time/MathUtils.java#L401 The code ((a % b) + b) % b; is short and involves no branches, which should aid performance and inlining. Is this to do with

Re: Code review request: 6282196 There should be Math.mod(number, modulo) methods

2012-02-22 Thread Roger Riggs
On 02/22/2012 09:37 AM, Stephen Colebourne wrote: Can you explain why the mod implementation differs from that in JSR-310? https://github.com/ThreeTen/threeten/blob/master/src/main/java/javax/time/MathUtils.java#L401 The code ((a % b) + b) % b; is short and involves no branches, which should

Re: Code review request: 6282196 There should be Math.mod(number, modulo) methods

2012-02-22 Thread Stephen Colebourne
Thanks for the explanation, I don't think that the change in floorDiv behaviour will cause JSR-310 a problem Stephen On 22 February 2012 16:21, Roger Riggs roger.ri...@oracle.com wrote: On 02/22/2012 09:37 AM, Stephen Colebourne wrote: Can you explain why the mod implementation differs from