mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
fix math functions
This commit is contained in:
parent
dad3acceea
commit
2e2b6c96ab
30 changed files with 121 additions and 84 deletions
|
@ -1,10 +1,10 @@
|
|||
#ifndef SPROUT_MATH_FMIN_HPP
|
||||
#define SPROUT_MATH_FMIN_HPP
|
||||
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/math/detail/config.hpp>
|
||||
#include <sprout/math/isnan.hpp>
|
||||
#include <sprout/type_traits/float_promote.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
|
||||
|
@ -17,9 +17,8 @@ namespace sprout {
|
|||
>
|
||||
inline SPROUT_CONSTEXPR FloatType
|
||||
fmin(FloatType x, FloatType y) {
|
||||
return x > y && !y == std::numeric_limits<FloatType>::quiet_NaN() ? y : x;
|
||||
return y < x && !sprout::math::isnan(y) ? y : x;
|
||||
}
|
||||
|
||||
template<
|
||||
typename ArithmeticType1,
|
||||
typename ArithmeticType2,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue