// Copyright 2023 Matt Borland // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #ifndef BOOST_DECIMAL_DETAIL_CMATH_ISLESS_HPP #define BOOST_DECIMAL_DETAIL_CMATH_ISLESS_HPP #include #include #include #include #ifndef BOOST_DECIMAL_BUILD_MODULE #include #include #endif namespace boost { namespace decimal { BOOST_DECIMAL_EXPORT template constexpr auto isless(const T lhs, const T rhs) noexcept BOOST_DECIMAL_REQUIRES_RETURN(detail::is_decimal_floating_point_v, T, bool) { #ifndef BOOST_DECIMAL_FAST_MATH if (isnan(lhs) || isnan(rhs)) { return false; } #endif return lhs < rhs; } BOOST_DECIMAL_EXPORT template constexpr auto islessequal(const T lhs, const T rhs) noexcept BOOST_DECIMAL_REQUIRES_RETURN(detail::is_decimal_floating_point_v, T, bool) { #ifndef BOOST_DECIMAL_FAST_MATH if (isnan(lhs) || isnan(rhs)) { return false; } #endif return lhs <= rhs; } BOOST_DECIMAL_EXPORT template constexpr auto islessgreater(const T lhs, const T rhs) noexcept BOOST_DECIMAL_REQUIRES_RETURN(detail::is_decimal_floating_point_v, T, bool) { #ifndef BOOST_DECIMAL_FAST_MATH if (isnan(lhs) || isnan(rhs)) { return false; } #endif return lhs < rhs || lhs > rhs; } } // namespace decimal } // namespace boost #endif // BOOST_DECIMAL_DETAIL_CMATH_ISLESS_HPP