fix exponential functions

This commit is contained in:
bolero-MURAKAMI 2013-04-25 15:36:19 +09:00
parent 32c3ba02d4
commit dad3acceea
41 changed files with 180 additions and 354 deletions

View file

@ -21,13 +21,16 @@ namespace sprout {
>
inline SPROUT_CONSTEXPR int
ilogb(FloatType x) {
return sprout::iszero(x) ? FP_ILOGB0
: sprout::isinf(x) ? INT_MAX
: sprout::isnan(x) ? FP_ILOGBNAN
: static_cast<int>(sprout::logb(x))
return sprout::math::iszero(x) ? FP_ILOGB0
: sprout::math::isinf(x) ? INT_MAX
: sprout::math::isnan(x) ? FP_ILOGBNAN
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
: std::ilogb(x)
#else
: static_cast<int>(sprout::math::logb(x))
#endif
;
}
template<
typename IntType,
typename sprout::enabler_if<std::is_integral<IntType>::value>::type = sprout::enabler
@ -38,7 +41,7 @@ namespace sprout {
}
} // namespace detail
using NS_SPROUT_MATH_DETAIL::ilogb;
using sprout::math::detail::ilogb;
} // namespace math
using sprout::math::ilogb;