fix erf, erfc

fix for special values: trigonometric functions
This commit is contained in:
bolero-MURAKAMI 2013-04-23 23:07:20 +09:00
parent 5f40808f75
commit a27c83e939
12 changed files with 313 additions and 87 deletions

View file

@ -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