UNPKG
random
Version:
latest (5.4.1)
5.4.1
5.4.0
5.3.0
5.2.0
5.1.1
5.1.0
5.0.1
5.0.0
4.1.0
4.0.3
4.0.2
4.0.1
4.0.0
3.0.6
3.0.5
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.2.0
2.1.1
2.1.0
2.0.13
2.0.12
2.0.11
2.0.10
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
1.0.0-beta-1
1.0.0-beta
0.1.0
Seedable random number generator supporting many common distributions.
transitive-bullshit/random
random
/
dist
/
esm
/
distributions
/
exponential.js
8 lines
•
254 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
import { numberValidator } from
'../validation'
; export default (random,
lambda
=
1
) => { numberValidator(
lambda
).isPositive();
return
() => {
return
-
Math
.log(
1
- random.
next
()) /
lambda
; }; };
//
# sourceMappingURL=exponential.js.map