From bbb32c31f8aa51baef5330eaee69f4996f5c27a4 Mon Sep 17 00:00:00 2001 From: Rinzii Date: Thu, 29 Feb 2024 18:27:42 -0500 Subject: [PATCH] Cleanup --- include/ccmath/detail/compare/isinf.hpp | 36 ++++++++++--------------- include/ccmath/detail/compare/isnan.hpp | 6 +++++ test/basic/remainder_test.cpp | 2 +- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/include/ccmath/detail/compare/isinf.hpp b/include/ccmath/detail/compare/isinf.hpp index ac002380..7368d5b4 100644 --- a/include/ccmath/detail/compare/isinf.hpp +++ b/include/ccmath/detail/compare/isinf.hpp @@ -13,30 +13,22 @@ namespace ccm { - namespace - { - namespace impl - { - template - inline constexpr bool isinf_impl(T x) noexcept - { - if constexpr (std::numeric_limits::is_signed) - { - return x == -std::numeric_limits::infinity() || x == std::numeric_limits::infinity(); - } - else - { - return x == std::numeric_limits::infinity(); - } - } - } - } - + /** + * @brief + * @tparam Real + * @param x + * @return + */ template >> inline constexpr bool isinf(Real x) noexcept { - return impl::isinf_impl(x); + if constexpr (std::numeric_limits::is_signed) + { + return x == -std::numeric_limits::infinity() || x == std::numeric_limits::infinity(); + } + else + { + return x == std::numeric_limits::infinity(); + } } - - } // namespace ccm diff --git a/include/ccmath/detail/compare/isnan.hpp b/include/ccmath/detail/compare/isnan.hpp index cd92f62b..0a1a2909 100644 --- a/include/ccmath/detail/compare/isnan.hpp +++ b/include/ccmath/detail/compare/isnan.hpp @@ -12,6 +12,12 @@ namespace ccm { + /** + * @brief + * @tparam T + * @param x + * @return + */ template inline constexpr bool isnan(T x) noexcept { diff --git a/test/basic/remainder_test.cpp b/test/basic/remainder_test.cpp index bc0c9348..6b8edee9 100644 --- a/test/basic/remainder_test.cpp +++ b/test/basic/remainder_test.cpp @@ -10,7 +10,7 @@ // TODO: Investigate why when including remainder it causes a linker error with gtest. This appears to not be an issue outside of the test environment. //#include -#include +//#include TEST(CcmathBasicTests, Remainder)