mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2024-11-12 21:09:01 +00:00
add math::phi
This commit is contained in:
parent
57d2a8bc21
commit
6e09fc2ee5
3 changed files with 130 additions and 117 deletions
|
@ -11,5 +11,6 @@
|
|||
#include <sprout/config.hpp>
|
||||
#include <sprout/math/functions.hpp>
|
||||
#include <sprout/math/constants.hpp>
|
||||
#include <sprout/math/constant_variables.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_MATH_HPP
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
|
||||
|
||||
namespace sprout {
|
||||
#if SPROUT_USE_VARIABLE_TEMPLATES
|
||||
namespace math {
|
||||
#if SPROUT_USE_VARIABLE_TEMPLATES
|
||||
//
|
||||
// pi
|
||||
//
|
||||
|
@ -110,8 +110,13 @@ namespace sprout {
|
|||
SPROUT_STATIC_CONSTEXPR T ln_ten_v = sprout::math::ln_ten<T>();
|
||||
template<typename T>
|
||||
SPROUT_STATIC_CONSTEXPR T ln_two_v = sprout::math::ln_two<T>();
|
||||
} // namespace math
|
||||
//
|
||||
// phi
|
||||
//
|
||||
template<typename T>
|
||||
SPROUT_STATIC_CONSTEXPR T phi_v = sprout::math::phi<T>();
|
||||
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
|
||||
} // namespace math
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_MATH_CONSTANT_VARIABLES_HPP
|
||||
|
|
|
@ -154,6 +154,13 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR T ln_two() {
|
||||
return static_cast<T>(0.693147180559945309417232121458176568075500134360255254120680009493393621969694715605863326996418687542001481021L);
|
||||
}
|
||||
//
|
||||
// phi
|
||||
//
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR T phi() {
|
||||
return static_cast<T>(1.61803398874989484820458683436563811772030917980576286213544862270526046281890244970720720418939113748475408807L);
|
||||
}
|
||||
} // namespace math
|
||||
} // namespace sprout
|
||||
|
||||
|
|
Loading…
Reference in a new issue