mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
fix: math functions (support for inferior C++14 standard)
add C++14 constexpr modifying algorithms
This commit is contained in:
parent
58cff54e0d
commit
c58c9cc0fc
106 changed files with 3465 additions and 2144 deletions
|
@ -22,20 +22,20 @@ namespace sprout {
|
|||
is_even_unchecked(T x) {
|
||||
return sprout::math::fmod(x, T(2)) == T(0);
|
||||
}
|
||||
|
||||
template<
|
||||
typename FloatType,
|
||||
typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
is_even(FloatType x) {
|
||||
return sprout::math::isfinite(x)
|
||||
&& sprout::math::detail::is_even_unchecked(x)
|
||||
;
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
using sprout::math::detail::is_even;
|
||||
//
|
||||
// is_even
|
||||
//
|
||||
template<
|
||||
typename FloatType,
|
||||
typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
is_even(FloatType x) {
|
||||
return sprout::math::isfinite(x)
|
||||
&& sprout::math::detail::is_even_unchecked(x)
|
||||
;
|
||||
}
|
||||
} // namespace math
|
||||
|
||||
using sprout::math::is_even;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue