Skip to content

Commit

Permalink
ensure that do nto have control reaches end of non-void function
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Fowlie committed Sep 26, 2019
1 parent 31d3e16 commit 8da82c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/derivatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ double K1(cdouble x) {
} else if (imag(x) != 0.) {
return -0.5 * M_PI * gsl_sf_bessel_Yn(1, imag(x));
}
return std::numeric_limits<double>::quiet_NaN();
}

double K0(cdouble x) {
Expand All @@ -77,6 +78,7 @@ double K0(cdouble x) {
} else if (imag(x) != 0.) {
return -0.5 * M_PI * gsl_sf_bessel_Yn(0, imag(x));
}
return std::numeric_limits<double>::quiet_NaN();
}

double D1_bessel_sum(double y_squared, double abs_error, double rel_error,
Expand Down
2 changes: 2 additions & 0 deletions src/thermal_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <stdexcept>
#include <complex>
#include <algorithm>
#include <limits>

/*! \f$y^2\f$ that is considered \f$y^2 \ll 0\f$ */
constexpr double neg_y_squared = -1.E3;
Expand Down Expand Up @@ -505,6 +506,7 @@ double K2(cdouble x, bool fast = false) {
return M_PI_2 * gsl_sf_bessel_Yn(2, imag(x));
}
}
return std::numeric_limits<double>::quiet_NaN();
}

double bessel_sum(double y_squared, double abs_error, double rel_error,
Expand Down

0 comments on commit 8da82c9

Please sign in to comment.