Skip to content
Snippets Groups Projects
Commit 58f6c626 authored by Arkerthan's avatar Arkerthan
Browse files

JSdoc improvements for random.js

parent 6174eb7c
No related branches found
No related tags found
1 merge request!11271Fixes
/** /**
* generate two independent Gaussian numbers using Box-Muller transform. * generate two independent Gaussian numbers using Box-Muller transform.
* mean and deviation specify the desired mean and standard deviation. * mean and deviation specify the desired mean and standard deviation.
* @param {number} [mean] * @param {number} [mean=0]
* @param {number} [deviation] * @param {number} [deviation=1]
* @returns {number[]} * @returns {number[]}
*/ */
function gaussianPair(mean = 0, deviation = 1) { function gaussianPair(mean = 0, deviation = 1) {
...@@ -47,10 +47,10 @@ App.Utils.Math.limitedSkewedGaussian = function(max, min, skew) { ...@@ -47,10 +47,10 @@ App.Utils.Math.limitedSkewedGaussian = function(max, min, skew) {
* Generate a random integer with a normal distribution between min and max (both inclusive). * Generate a random integer with a normal distribution between min and max (both inclusive).
* Default parameters result in truncating the standard normal distribution between -3 and +3. * Default parameters result in truncating the standard normal distribution between -3 and +3.
* Not specifying min/max results in rerolling val approximately 0.3% of the time. * Not specifying min/max results in rerolling val approximately 0.3% of the time.
* @param {number} [mean] * @param {number} [mean=0]
* @param {number} [deviation] * @param {number} [deviation=1]
* @param {number} [min] * @param {number} [min=mean-3*deviation]
* @param {number} [max] * @param {number} [max=mean+3*deviation]
* @returns {number} * @returns {number}
*/ */
function normalRandInt(mean = 0, deviation = 1, min = mean - 3 * deviation, max = mean + 3 * deviation) { function normalRandInt(mean = 0, deviation = 1, min = mean - 3 * deviation, max = mean + 3 * deviation) {
...@@ -66,7 +66,7 @@ function normalRandInt(mean = 0, deviation = 1, min = mean - 3 * deviation, max ...@@ -66,7 +66,7 @@ function normalRandInt(mean = 0, deviation = 1, min = mean - 3 * deviation, max
* If count is defined, chooses that many random numbers between min and max and returns the average. This is an approximation of a normal distribution. * If count is defined, chooses that many random numbers between min and max and returns the average. This is an approximation of a normal distribution.
* @param {number} min * @param {number} min
* @param {number} max * @param {number} max
* @param {number} [count] * @param {number} [count=1]
* @returns {number} * @returns {number}
*/ */
function jsRandom(min, max, count = 1) { function jsRandom(min, max, count = 1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment