mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-12 14:54:10 +00:00
fix erf, erfc
fix for special values: trigonometric functions
This commit is contained in:
parent
5f40808f75
commit
a27c83e939
12 changed files with 313 additions and 87 deletions
|
@ -763,17 +763,27 @@ namespace sprout {
|
|||
return sprout::math::detail::factorials<type>::limit;
|
||||
}
|
||||
//
|
||||
// unchecked_factorial
|
||||
//
|
||||
template<typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
|
||||
inline SPROUT_CONSTEXPR T unchecked_factorial(std::size_t x) {
|
||||
typedef typename std::remove_cv<T>::type type;
|
||||
return sprout::math::detail::factorials<type>::table[x];
|
||||
}
|
||||
//
|
||||
// factorial
|
||||
//
|
||||
template<typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
|
||||
inline SPROUT_CONSTEXPR T factorial(std::size_t x) {
|
||||
typedef typename std::remove_cv<T>::type type;
|
||||
return SPROUT_ASSERT(x <= sprout::math::factorial_limit<type>()),
|
||||
sprout::math::detail::factorials<type>::table[x]
|
||||
sprout::math::unchecked_factorial<T>(x)
|
||||
;
|
||||
}
|
||||
} // namespace math
|
||||
|
||||
using sprout::math::factorial_limit;
|
||||
using sprout::math::unchecked_factorial;
|
||||
using sprout::math::factorial;
|
||||
} // namespace sprout
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue