JavaScript Math.random() Test

Testing 1 to 10. Running 1000 tests.
Parameters


Floor

Math.floor(Math.random() * (max - min + 1) + min)

Ceil

Math.ceil(Math.random() * (max - min + 1) + min - 1)
Note: There is a minute possibility that this function will return (min-1). This is why floor is a better choice.

Round

Math.round(Math.random() * (max - min) + min)

This script was inspired by Duncan Crombie's Useful JavaScript - Random Numbers