|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
331 bytes
|
| Line | |
|---|
| 1 | import defaultSource from "./defaultSource.js";
|
|---|
| 2 |
|
|---|
| 3 | export default (function sourceRandomExponential(source) {
|
|---|
| 4 | function randomExponential(lambda) {
|
|---|
| 5 | return function() {
|
|---|
| 6 | return -Math.log1p(-source()) / lambda;
|
|---|
| 7 | };
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | randomExponential.source = sourceRandomExponential;
|
|---|
| 11 |
|
|---|
| 12 | return randomExponential;
|
|---|
| 13 | })(defaultSource);
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.