diff --git a/Base/Const/PhysicalConstants.h b/Base/Const/PhysicalConstants.h index 7e8f4975b33cba4df1bacc3c1a529b0ba9ceef94..cb5f1959175bb98f707e9fc9f2fc3577f0e56ca0 100644 --- a/Base/Const/PhysicalConstants.h +++ b/Base/Const/PhysicalConstants.h @@ -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