E.V.E
v2022.03.00

◆ is_finite

eve::is_finite = {}
inlineconstexpr

Returns a logical true if and only if the element is a finite value.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
eve::as_logical<T> is_finite(T x) noexcept;
}
constexpr callable_is_finite_ is_finite
Returns a logical true if and only if the element is a finite value.
Definition: is_finite.hpp:61
Definition: all_of.hpp:22

Parameters

Return value

The call is_finite(x) is semantically equivalent to eve::is_not_nan(x-x), in particular this is always true for integral types.

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.5f, -2.0f, -123.345f,
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> is_finite(pf) = " << eve::is_finite(pf) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> is_finite(xf) = " << eve::is_finite(xf) << '\n';
return 0;
}
constexpr callable_nan_ nan
Computes the IEEE NaN constant.
Definition: nan.hpp:53
constexpr callable_minf_ minf
Computes the -infinity ieee value.
Definition: minf.hpp:95
constexpr callable_inf_ inf
Computes the infinity ieee value.
Definition: inf.hpp:58
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65

Semantic Modifiers