diff --git a/hspm/src/solver.cpp b/hspm/src/solver.cpp index 897204050acd55dd98291563fe99c089065e3d70..3cadd307ba7aeab2699f9ed17030a16958c54017 100644 --- a/hspm/src/solver.cpp +++ b/hspm/src/solver.cpp @@ -84,7 +84,7 @@ double HSPM::solveOffBodyKutta() { double _tau_terms = 2*(_a*_b + _c*_d - _e*_f - _g*_h); double _const_terms = pow(_b,2) + pow(_d,2) - pow(_f,2) - pow(_h,2); - if (_tau2_terms < 1e-10) + if (abs(_tau2_terms) < 1e-10) return -_const_terms / _tau_terms; // If the quadratic equation is degenerate, we can solve it directly // Solve the quadratic equation