diff options
author | Minteck <contact@minteck.org> | 2021-12-21 16:52:28 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2021-12-21 16:52:28 +0100 |
commit | 46e43f4bde4a35785b4997b81e86cd19f046b69b (patch) | |
tree | c53c2f826f777f9d6b2d249dab556feb72a6c3a6 /src/node_modules/chance/docs/miscellaneous/normal.md | |
download | langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.gz langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.bz2 langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.zip |
Commit
Diffstat (limited to 'src/node_modules/chance/docs/miscellaneous/normal.md')
-rw-r--r-- | src/node_modules/chance/docs/miscellaneous/normal.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/node_modules/chance/docs/miscellaneous/normal.md b/src/node_modules/chance/docs/miscellaneous/normal.md new file mode 100644 index 0000000..da3b580 --- /dev/null +++ b/src/node_modules/chance/docs/miscellaneous/normal.md @@ -0,0 +1,35 @@ +# normal + +```js +// usage +chance.normal() +chance.normal({mean: 100}) +chance.normal({mean: 100, dev: 15}) +``` + +Return a normally-distributed random variate. + +```js +chance.normal() +=> 0.4244767651300604 +``` + +By default this starts with a mean of `0` and a standard deviation of `1` which +is the standard normal distribution. + +Optionally specify a mean and/or deviation. + +```js +// Notice, since no deviation was specified, using the default of `1` +chance.normal({mean: 100}) +=> 99.68352269988522 + +// For example, to get a random IQ (which by definition has a mean of 100 +// and a standard deviation of 15) +chance.normal({mean: 100, dev: 15}) +=> 85.11040121833615 +``` + +Used in combination with the above generators, this can be an extremely powerful +way to get more realistic results as often "pure random" results fail to +approximate the real world. |