1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

replace implementation <cmath> functions to Sprout.Math.Functions

This commit is contained in:
bolero-MURAKAMI 2012-05-09 10:15:19 +09:00
parent 6ccd6e1cf4
commit 6bb2d0fb87
21 changed files with 212 additions and 106 deletions

View file

@ -2,6 +2,7 @@
#define SPROUT_MATH_COS_HPP
#include <cstddef>
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/math/factorial.hpp>
@ -33,12 +34,16 @@ namespace sprout {
inline SPROUT_CONSTEXPR FloatType
cos(FloatType x) {
typedef double type;
return static_cast<FloatType>(sprout::math::detail::cos_impl(
static_cast<type>(x),
type(1),
1,
static_cast<type>(x) * static_cast<type>(x)
));
return x == std::numeric_limits<FloatType>::infinity()
|| x == -std::numeric_limits<FloatType>::infinity()
? std::numeric_limits<FloatType>::quiet_NaN()
: static_cast<FloatType>(sprout::math::detail::cos_impl(
static_cast<type>(x),
type(1),
1,
static_cast<type>(x) * static_cast<type>(x)
))
;
}
template<