mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-10 14:44:11 +00:00
fix math functions
This commit is contained in:
parent
fccb16687b
commit
7794e56192
27 changed files with 342 additions and 102 deletions
|
@ -1,7 +1,6 @@
|
|||
#ifndef SPROUT_MATH_FLOAT_EXPONENT_HPP
|
||||
#define SPROUT_MATH_FLOAT_EXPONENT_HPP
|
||||
|
||||
#include <climits>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
|
@ -19,9 +18,9 @@ namespace sprout {
|
|||
>
|
||||
inline SPROUT_CONSTEXPR int
|
||||
float_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::ilogb(x) + 1
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue