Skip to content

Commit

Permalink
fix(random): HOF issue w/ exponential()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Apr 18, 2021
1 parent 3b3b5d8 commit 12586b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/random/src/distributions/exponential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ import { SYSTEM } from "../system";
* @param rnd
* @param lambda - event interval [0,Inf)
*/
export const exponential = (rnd: IRandom = SYSTEM, lambda = 10) => () =>
lambda === 0 ? () => Infinity : -Math.log(1 - rnd.float(1)) / lambda;
export const exponential = (rnd: IRandom = SYSTEM, lambda = 10) =>
lambda === 0 ? () => Infinity : () => -Math.log(1 - rnd.float(1)) / lambda;

0 comments on commit 12586b9

Please sign in to comment.