From c64e64dac2e9415f54341ed80cc7e0b6462715fa Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 23 Mar 2021 17:09:31 -0500 Subject: [PATCH] Replace pi constant with more accurate version --- include/openmc/constants.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/include/openmc/constants.h b/include/openmc/constants.h index 29dd3b73a9..49acf1d57b 100644 --- a/include/openmc/constants.h +++ b/include/openmc/constants.h @@ -69,16 +69,14 @@ constexpr double EXTSRC_REJECT_FRACTION {0.05}; // ============================================================================ // MATH AND PHYSICAL CONSTANTS -// Values here are from the Committee on Data for Science and Technology -// (CODATA) 2018 recommendation (https://physics.nist.gov/cuu/Constants/). - -// TODO: cmath::M_PI has 3 more digits precision than the Fortran constant we -// use so for now we will reuse the Fortran constant until we are OK with -// modifying test results -constexpr double PI {3.1415926535898}; +// TODO: replace with when we go for C++20 +constexpr double PI {3.141592653589793238462643383279502884L}; const double SQRT_PI {std::sqrt(PI)}; constexpr double INFTY {std::numeric_limits::max()}; +// Values here are from the Committee on Data for Science and Technology +// (CODATA) 2018 recommendation (https://physics.nist.gov/cuu/Constants/). + // Physical constants constexpr double MASS_NEUTRON {1.00866491595}; // mass of a neutron in amu constexpr double MASS_NEUTRON_EV {939.56542052e6}; // mass of a neutron in eV/c^2 @@ -110,8 +108,8 @@ constexpr int NUCLIDE_NONE {-1}; // Temperature treatment method enum class TemperatureMethod { - NEAREST, - INTERPOLATION + NEAREST, + INTERPOLATION }; // Reaction types