getRandInt - Random Numbers Made EZ!
As Seen @ http://spyk3lc.blogspot.com/2016/04/javascript-get-random-number-between.html
This simple and easy to use method allows you to quickly and easly get a random Float, whole Int, or n
Decimal long String Random Number based on 2 given numbers. Provide "min" & "max" in order to get any random number from the minimum to the maximum. OR, swap the order of the parameters and ensure you never get the exact minimum or maximum numbers, but always a random number between the two!
- Raw JS for Global Method "getRandInt"
- Raw JS Minified for Global Method "getRandInt"
- Raw JS for Math["getRandInt"]
- Raw JS Minified for Math["getRandInt"]
- Raw JS for jQuery.getRandInt
- All Method Types in 1 Package!
getRandInt(1, 2)
= 1.2783833924813244 // Will be any Number from min to maxgetRandInt(1, 2, false)
= 1.048028815274805 // Will be any Number from min to maxgetRandInt(1, 2, true)
= 1 // Will be any Whole Number from min to maxgetRandInt(1, 2, 19)
= 1.5612295703389058588 // Will have 19 decimal places.getRandInt(2, 1)
= 1.3221148112756618 // Will never equal 2 or 1