[Solved] Does Java ThreadLocalRandom.current().nextGaussian() have a limit?


nextGaussian() can return any value that can represented by a double data type. Gaussian distribution approaches but never reaches 0 on either side. So it’s theoretically possible to get a value of Double.MAX_VALUE, but very unlikely.

Gaussian distribution looks like this:
enter image description here
(http://hyperphysics.phy-astr.gsu.edu/hbase/Math/gaufcn.html)

The distribution stretches to positive and negative infinity, so there is theoretically no absolute limit. Since we’re running in the VM, and nextGaussian() returns a double, we’re constrained to the magnitude and precision that a double can represent.

2

solved Does Java ThreadLocalRandom.current().nextGaussian() have a limit?