E.V.E  0.1-beta

◆ is_real

eve::is_real = {}
inlineconstexpr

Callable object computing the is_real logical value.

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

Members Functions

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

auto operator()(floating_value auto x) const noexcept;
Definition: value.hpp:83

Parameters

x: value.

Return value

The call is_real(x)is semantically equivalent to is_eqz(imag(x))


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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/is_real.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -0.0f, -2.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> is_real(pf) = " << eve::is_real(pf) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> is_real(xf) = " << eve::is_real(xf) << '\n';
return 0;
}
constexpr callable_is_real_ is_real
Callable object computing the is_real logical value.
Definition: is_real.hpp:74
Wrapper for SIMD registers.
Definition: wide.hpp:65