Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Implemented
-
None
-
None
Description
According to java spec
Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE
So,
Math.abs(rnd.nextInt())
might return negative value
To generate positive random int value we can use
rnd.nextInt(Integer.MAX_VALUE)
Integer.MAX_VALUE will be excluded btw
Attachments
Issue Links
- links to