Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinzii committed Feb 29, 2024
1 parent e78d00e commit bbb32c3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
36 changes: 14 additions & 22 deletions include/ccmath/detail/compare/isinf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,22 @@

namespace ccm
{
namespace
{
namespace impl
{
template <typename T>
inline constexpr bool isinf_impl(T x) noexcept
{
if constexpr (std::numeric_limits<T>::is_signed)
{
return x == -std::numeric_limits<T>::infinity() || x == std::numeric_limits<T>::infinity();
}
else
{
return x == std::numeric_limits<T>::infinity();
}
}
}
}

/**
* @brief
* @tparam Real
* @param x
* @return
*/
template <typename Real, typename = std::enable_if_t<std::is_floating_point_v<Real>>>
inline constexpr bool isinf(Real x) noexcept
{
return impl::isinf_impl(x);
if constexpr (std::numeric_limits<Real>::is_signed)
{
return x == -std::numeric_limits<Real>::infinity() || x == std::numeric_limits<Real>::infinity();
}
else
{
return x == std::numeric_limits<Real>::infinity();
}
}


} // namespace ccm
6 changes: 6 additions & 0 deletions include/ccmath/detail/compare/isnan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

namespace ccm
{
/**
* @brief
* @tparam T
* @param x
* @return
*/
template <typename T>
inline constexpr bool isnan(T x) noexcept
{
Expand Down
2 changes: 1 addition & 1 deletion test/basic/remainder_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ccmath/detail/basic/remainder.hpp>
#include <cmath>
//#include <cmath>


TEST(CcmathBasicTests, Remainder)
Expand Down

0 comments on commit bbb32c3

Please sign in to comment.