Skip to content
Snippets Groups Projects
Commit 0f02c972 authored by AlQuemist's avatar AlQuemist
Browse files

Base/Const/PhysicalConstants: add pi to constants

parent 051fd430
No related branches found
No related tags found
1 merge request!2727Avoid using C++20 features to keep the libraries maintainable on older systems
......@@ -17,7 +17,11 @@
#endif // SWIG
#ifndef BORNAGAIN_BASE_CONST_PHYSICALCONSTANTS_H
#define BORNAGAIN_BASE_CONST_PHYSICALCONSTANTS_H
#ifdef BA_CPP20
#include <numbers>
#endif // BA_CPP20
//! Physical constants.
namespace PhysConsts {
......@@ -30,6 +34,11 @@ constexpr double r_e = 2.8179403262e-15; //!< Thomson scattering length (\f$ r
constexpr double gamma_n = 1.91304272; //!< \f$\gamma\f$ factor for neutron magnetic moment,
//!< \f$\mu_n = \gamma \cdot \mu_N\f$
constexpr double g_factor_n = -3.82608545; //!< neutron g-factor
#ifdef BA_CPP20
constexpr double pi = std::numbers::pi;
#else
constexpr double pi = 3.141592653589793238462643383279502884L; // OEIS: A000796
#endif // BA_CPP20
} // namespace PhysConsts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment