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

@ -19,9 +19,9 @@ namespace sprout {
>
inline SPROUT_CONSTEXPR int
float2_exponent(FloatType x) {
return x == 0 ? 0
return sprout::math::isnan(x) ? 0
: x == 0 ? 0
: x == std::numeric_limits<FloatType>::infinity() || x == -std::numeric_limits<FloatType>::infinity() ? 0
: sprout::math::isnan(x) ? FP_ILOGBNAN
: sprout::math::ilogb2(x) + 1
;
}