mirror of
https://github.com/wassname/random.js.git
synced 2026-09-09 11:32:35 +08:00
Merge pull request #1 from colesbury/master
Fix beta distribution when v < w and min, max != 0, 1.
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
exports.beta = function (v, w, min, max) {
|
||||
if (v < w) {
|
||||
return max - (max - min) * _this.beta(w, v, min, max);
|
||||
return max - (max - min) * _this.beta(w, v, 0, 1);
|
||||
}
|
||||
var y1 = _this.gamma(0, 1, v),
|
||||
y2 = _this.gamma(0, 1, w);
|
||||
|
||||
Reference in New Issue
Block a user