Skip to content

Commit 6f87380

Browse files
committed
Fixed random crash with position simulation
1 parent 3116c40 commit 6f87380

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/egg-gencat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ int main(int argc, char* argv[]) {
885885

886886
// Compute how many deeper levels we need to go with respect to
887887
// rstart to reach the local density
888-
opt.levels = ceil(log(rho*dpi*sqr(rstart))/log(opt.eta));
888+
opt.levels = ceil(max(0, log(rho*dpi*sqr(rstart)))/log(opt.eta));
889889

890890
// Compute how many homogeneous starting positions we need
891891
// above rstart

0 commit comments

Comments
 (0)