mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
workaround for no c++11 numeric_limits
This commit is contained in:
parent
ce16e24637
commit
7a1974742a
110 changed files with 727 additions and 436 deletions
|
@ -10,7 +10,7 @@
|
|||
# include <sprout/math/logb.hpp>
|
||||
#else
|
||||
# include <cstdint>
|
||||
# include <limits>
|
||||
# include <sprout/limits.hpp>
|
||||
# include <sprout/detail/pow.hpp>
|
||||
# include <sprout/math/detail/float_compute.hpp>
|
||||
# include <sprout/math/isnan.hpp>
|
||||
|
@ -123,9 +123,9 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR FloatType
|
||||
logb2(FloatType x) {
|
||||
return sprout::math::isnan(x) ? x
|
||||
: x == 0 ? -std::numeric_limits<FloatType>::infinity()
|
||||
: x == std::numeric_limits<FloatType>::infinity() || x == -std::numeric_limits<FloatType>::infinity()
|
||||
? std::numeric_limits<FloatType>::infinity()
|
||||
: x == 0 ? -sprout::numeric_limits<FloatType>::infinity()
|
||||
: x == sprout::numeric_limits<FloatType>::infinity() || x == -sprout::numeric_limits<FloatType>::infinity()
|
||||
? sprout::numeric_limits<FloatType>::infinity()
|
||||
: static_cast<FloatType>(sprout::math::detail::logb2_impl(static_cast<typename sprout::math::detail::float_compute<FloatType>::type>(x)))
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue