maths: remove util::is_nan in preference of std::isnan
This commit is contained in:
parent
4116442e40
commit
2ec9a7ebe6
2
cast.hpp
2
cast.hpp
@ -113,7 +113,7 @@ namespace util::cast {
|
|||||||
auto dst = static_cast<DstT> (src);
|
auto dst = static_cast<DstT> (src);
|
||||||
|
|
||||||
if constexpr (std::is_floating_point_v<SrcT>) {
|
if constexpr (std::is_floating_point_v<SrcT>) {
|
||||||
if (util::is_nan (src)) {
|
if (std::isnan (src)) {
|
||||||
// NaNs must remaing as NaN's. They're important.
|
// NaNs must remaing as NaN's. They're important.
|
||||||
CHECK (std::is_floating_point_v<DstT>);
|
CHECK (std::is_floating_point_v<DstT>);
|
||||||
CHECK (std::isnan (dst));
|
CHECK (std::isnan (dst));
|
||||||
|
24
maths.hpp
24
maths.hpp
@ -188,30 +188,6 @@ namespace util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
template <typename T>
|
|
||||||
constexpr
|
|
||||||
typename std::enable_if_t<
|
|
||||||
std::is_floating_point<T>::value, bool
|
|
||||||
>
|
|
||||||
is_nan (T t)
|
|
||||||
{
|
|
||||||
return std::isnan (t);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
template <typename T>
|
|
||||||
constexpr
|
|
||||||
typename std::enable_if_t<
|
|
||||||
!std::is_floating_point<T>::value, bool
|
|
||||||
>
|
|
||||||
is_nan (const T&)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// exponentials
|
// exponentials
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user