Commit 400ef87c authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

make certain, that -log() doesn't overflow and assign a suitable maximum number instead.

parent 2fb666dc
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -49,6 +49,11 @@ double FixTempCSVR::gamdev(const int ia)
    x=1.0;
    for (j=1; j<=ia; j++)
      x *= random->uniform();

    // make certain, that -log() doesn't overflow.
    if (x < 2.2250759805e-308)
      x = 708.4;
    else
      x = -log(x);
  } else {
  restart: