fix math functions

This commit is contained in:
bolero-MURAKAMI 2013-05-06 00:22:08 +09:00
parent fccb16687b
commit 7794e56192
27 changed files with 342 additions and 102 deletions

View file

@ -18,9 +18,9 @@ namespace sprout {
>
inline SPROUT_CONSTEXPR FloatType
integer_part(FloatType x) {
return x == std::numeric_limits<FloatType>::infinity() ? std::numeric_limits<FloatType>::infinity()
return sprout::math::isnan(x) ? x
: x == std::numeric_limits<FloatType>::infinity() ? std::numeric_limits<FloatType>::infinity()
: x == -std::numeric_limits<FloatType>::infinity() ? -std::numeric_limits<FloatType>::infinity()
: sprout::math::isnan(x) ? std::numeric_limits<FloatType>::quiet_NaN()
: x == 0 ? x
: sprout::math::trunc(x)
;