mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-14 15:04:09 +00:00
add sprout/math/comparison.hpp
This commit is contained in:
parent
d51bd06eda
commit
1c65d59971
20 changed files with 379 additions and 109 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <sprout/config.hpp>
|
||||
#include <sprout/math/detail/config.hpp>
|
||||
#include <sprout/math/isinf.hpp>
|
||||
#include <sprout/math/equal_to.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -16,7 +17,7 @@ namespace sprout {
|
|||
template<typename FloatType>
|
||||
inline SPROUT_CONSTEXPR FloatType
|
||||
ceil_impl(FloatType x, FloatType x0) {
|
||||
return x - x0 < std::numeric_limits<FloatType>::epsilon() ? x0
|
||||
return sprout::math::equal_to(x, x0) ? x0
|
||||
: x0 + 1
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue