mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +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
|
@ -91,8 +91,7 @@ namespace sprout {
|
|||
template<typename FloatType, typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler>
|
||||
inline SPROUT_CONSTEXPR int
|
||||
float_digit_of_impl(FloatType val) {
|
||||
using sprout::floor;
|
||||
return static_cast<int>((val - floor(val)) * 10);
|
||||
return static_cast<int>((val - sprout::floor(val)) * 10);
|
||||
}
|
||||
template<typename FloatType>
|
||||
inline SPROUT_CONSTEXPR int
|
||||
|
@ -106,8 +105,7 @@ namespace sprout {
|
|||
template<typename FloatType, typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler>
|
||||
inline SPROUT_CONSTEXPR FloatType
|
||||
float_round_impl(FloatType val, FloatType p10) {
|
||||
using sprout::round;
|
||||
return round(val * p10) / p10;
|
||||
return sprout::round(val * p10) / p10;
|
||||
}
|
||||
template<typename FloatType>
|
||||
inline SPROUT_CONSTEXPR FloatType
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue