mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
handle zero case
This commit is contained in:
parent
9681f2f615
commit
c43fac4dcf
1 changed files with 1 additions and 1 deletions
|
@ -581,7 +581,7 @@ function exponential_rands(n=1, lambda=1, seed) =
|
|||
let(
|
||||
unif = is_def(seed) ? rands(0,1,n,seed=seed) : rands(0,1,n)
|
||||
)
|
||||
-(1/lambda) * [for(x=unif) ln(1-x)];
|
||||
-(1/lambda) * [for(x=unif) x==1 ? 708.3964185322641 : ln(1-x)]; // Use ln(min_float) when x is 1
|
||||
|
||||
// Function: spherical_random_points()
|
||||
// Usage:
|
||||
|
|
Loading…
Reference in a new issue