mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-16 15:14:13 +00:00
replace implementation <cmath> functions to Sprout.Math.Functions
This commit is contained in:
parent
6ccd6e1cf4
commit
6bb2d0fb87
21 changed files with 212 additions and 106 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue