From 53d3cd005f2267793b9489f0f39a5b8843468f67 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sat, 17 Sep 2022 09:46:33 -0500 Subject: [PATCH] Apply suggestions from @paulromano Co-authored-by: Paul Romano --- include/openmc/interpolate.h | 9 ++++----- tests/regression_tests/filter_energyfun/test.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/openmc/interpolate.h b/include/openmc/interpolate.h index 8ccdc5bd74..fd95e96a86 100644 --- a/include/openmc/interpolate.h +++ b/include/openmc/interpolate.h @@ -1,4 +1,3 @@ - #ifndef OPENMC_INTERPOLATE_H #define OPENMC_INTERPOLATE_H @@ -18,20 +17,20 @@ inline double interpolate_lin_lin( inline double interpolate_lin_log( double x0, double x1, double y0, double y1, double x) { - return y0 + log(x / x0) / log(x1 / x0) * (y1 - y0); + return y0 + std::log(x / x0) / std::log(x1 / x0) * (y1 - y0); } inline double interpolate_log_lin( double x0, double x1, double y0, double y1, double x) { - return y0 * exp((x - x0) / (x1 - x0) * log(y1 / y0)); + return y0 * std::exp((x - x0) / (x1 - x0) * std::log(y1 / y0)); } inline double interpolate_log_log( double x0, double x1, double y0, double y1, double x) { - double f = log(x / x0) / log(x1 / x0); - return y0 * exp(f * log(y1 / y0)); + double f = std::log(x / x0) / std::log(x1 / x0); + return y0 * std::exp(f * std::log(y1 / y0)); } inline double interpolate_lagrangian(const std::vector& xs, diff --git a/tests/regression_tests/filter_energyfun/test.py b/tests/regression_tests/filter_energyfun/test.py index 12144c1fda..44a2c44b0f 100644 --- a/tests/regression_tests/filter_energyfun/test.py +++ b/tests/regression_tests/filter_energyfun/test.py @@ -42,7 +42,7 @@ def model(): filt3 = openmc.EnergyFunctionFilter(x, y) filt3.interpolation = 'log-log' - filt4 = openmc.EnergyFunctionFilter(x , y) + filt4 = openmc.EnergyFunctionFilter(x, y) filt4.interpolation = 'linear-log' filt5 = openmc.EnergyFunctionFilter(x, y)