#ifndef SPROUT_MATH_GREATER_EQUAL_HPP #define SPROUT_MATH_GREATER_EQUAL_HPP #include #include #include #include #include namespace sprout { namespace math { namespace detail { template< typename FloatType1, typename FloatType2, typename sprout::enabler_if< std::is_floating_point::type>::value >::type = sprout::enabler > inline SPROUT_CONSTEXPR bool greater_equal_equal(FloatType1 x, FloatType2 y) { return sprout::math::equal_to(x, y) || x > y; } template< typename IntType1, typename IntType2, typename sprout::enabler_if< std::is_integral::type>::value && (std::is_unsigned::value == std::is_unsigned::value) >::type = sprout::enabler > inline SPROUT_CONSTEXPR bool greater_equal(IntType1 x, IntType2 y) { return x >= y; } template< typename IntType1, typename IntType2, typename sprout::enabler_if< std::is_integral::type>::value && std::is_signed::value && std::is_unsigned::value >::type = sprout::enabler > inline SPROUT_CONSTEXPR bool greater_equal(IntType1 x, IntType2 y) { typedef typename std::make_unsigned::type>::type type; return x < 0 ? false : static_cast(x) >= static_cast(y) ; } template< typename IntType1, typename IntType2, typename sprout::enabler_if< std::is_integral::type>::value && std::is_unsigned::value && std::is_signed::value >::type = sprout::enabler > inline SPROUT_CONSTEXPR bool greater_equal(IntType1 x, IntType2 y) { typedef typename std::make_unsigned::type>::type type; return y < 0 ? true : static_cast(x) >= static_cast(y) ; } } // namespace detail // // greater_equal_equal // template< typename T, typename U, typename sprout::enabler_if::value && std::is_arithmetic::value>::type = sprout::enabler > inline SPROUT_CONSTEXPR bool greater_equal(T x, U y) { return sprout::math::detail::greater_equal(x, y); } } // namespace math } // namespace sprout #endif // #ifndef SPROUT_MATH_GREATER_EQUAL_HPP