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

@ -11,15 +11,6 @@
namespace sprout {
namespace math {
namespace detail {
template<
typename FloatType,
typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR FloatType
abs(FloatType x) {
return x < 0 ? -x : x;
}
template<
typename FloatType,
typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler
@ -39,20 +30,6 @@ namespace sprout {
}
} // namespace detail
template<
typename FloatType,
typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR FloatType
abs(FloatType x) {
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::abs;
# else
using sprout::math::detail::abs;
# endif
return abs(x);
}
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION
using std::fabs;
# else
@ -60,7 +37,6 @@ namespace sprout {
# endif
} // namespace math
using sprout::math::abs;
using sprout::math::fabs;
} // namespace sprout