E.V.E  0.1-beta

◆ is_finite

eve::is_finite = {}
inlineconstexpr

Callable object computing the is_finite logical value.

Required header: #include <eve/function/is_finite.hpp>

Members Functions

Member Effect
operator() the computation of the is_finite logical value
operator[] Construct a conditional version of current function object

auto operator()(real_value auto x ) const noexcept;
Definition: value.hpp:93

Parameters

x: value.

Return value

The call:

constexpr callable_is_finite_ is_finite
Callable object computing the is_finite logical value.
Definition: is_finite.hpp:84
Wrapper for SIMD compatible logical types.
Definition: logical.hpp:36

is semantically equivalent to:

if constexpr(floating_real_value<T>) r = is_not_nan(x-x);
else constexpr(integral_real_value<T>) r = true_(as(x));
Definition: value.hpp:103
Definition: value.hpp:113
constexpr callable_true__ true_
Callable object computing the logical true_ value.
Definition: true.hpp:52
constexpr callable_is_not_nan_ is_not_nan
Callable object computing the is_not_nan logical value.
Definition: is_not_nan.hpp:83
Lightweight type-wrapper.
Definition: as.hpp:29

auto operator[]( conditional_expression auto cond ) const noexcept;

Higher-order function generating a masked version of eve::is_finite

Parameters

cond : conditional expression

Return value

A Callable object so that the expression is_finite[cond](x) is equivalent to if_else(cond,is_finite(x),false(as(is_finite(x))))


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/is_finite.hpp>
#include <eve/wide.hpp>
#include <eve/constant/inf.hpp>
#include <eve/constant/minf.hpp>
#include <eve/constant/nan.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
Callable object computing the nan value.
Definition: nan.hpp:52
constexpr callable_minf_ minf
Callable object computing the negative infinity value.
Definition: minf.hpp:55
constexpr callable_inf_ inf
Callable object computing the infinity ieee value.
Definition: inf.hpp:54
Wrapper for SIMD registers.
Definition: wide.hpp:65