mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-01-16 21:58:27 +01:00
handle zero case
This commit is contained in:
parent
9681f2f615
commit
c43fac4dcf
@ -581,7 +581,7 @@ function exponential_rands(n=1, lambda=1, seed) =
|
|||||||
let(
|
let(
|
||||||
unif = is_def(seed) ? rands(0,1,n,seed=seed) : rands(0,1,n)
|
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()
|
// Function: spherical_random_points()
|
||||||
// Usage:
|
// Usage:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user