E.V.E  0.1-beta

◆ is_imag

eve::is_imag = {}
inlineconstexpr

Callable object computing the is_imag logical value.

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

Members Functions

Member Effect
operator() the computation of the is_imag 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: floating value.

Return value

The call:

auto r = is_imag(x);
constexpr callable_is_imag_ is_imag
Callable object computing the is_imag logical value.
Definition: is_imag.hpp:81

is semantically equivalent to: auto r = real(x) == x;


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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/is_imag.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_imag(pf) = " << eve::is_imag(pf) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> is_imag(xf) = " << eve::is_imag(xf) << '\n';
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65