E.V.E
v2023.02.15

◆ logical_and

eve::logical_and = {}
inlineconstexpr

Computes the logical AND of its arguments.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T, eve::value U >
auto logical_and(T x, U y) noexcept;
}
constexpr callable_logical_and_ logical_and
Computes the logical AND of its arguments.
Definition: logical_and.hpp:67
Definition: abi.hpp:18

Parameters

Return value

Returns the logical AND of the two parameters following the logical operations semantic.

The call logical_and(x, y) is semantically equivalent to x && y if x or y is an simd value and does not shortcut.

Note
Although the infix notation with && is supported, the && operator on standard scalar types is the original one and so will return bool instead of eve::logical_value.

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using eve::is_even;
using eve::is_odd;
wide_ft pf = {3.0f, -2.0f, -3.0f, 51.04f};
wide_ft qf = {4.0f, -1.0f, -3.0f, 0.0f};
std::cout << "---- simd" << '\n'
<< " <- pf = " << pf << '\n'
<< " <- qf = " << qf << '\n'
<< " -> eve::logical_and(is_odd(pf), is_even(qf)) = " << eve::logical_and(is_odd(pf), is_even(qf)) << '\n';
float xf = 3.0f, yf = 4.5f;
std::cout << "---- scalar" << '\n'
<< " xf = " << xf << '\n'
<< " yf = " << yf << '\n'
<< " -> eve::logical_and(is_odd(xf), is_even(yf)) = " << eve::logical_and(is_odd(xf), is_even(yf)) << '\n'
<< " -> eve::logical_and(xf == 3, is_even(yf)) = " << eve::logical_and(xf == 3 , is_even(yf)) << '\n' ;
return 0;
}
constexpr callable_is_odd_ is_odd
Returns a logical true if and only if the element value is odd.
Definition: is_odd.hpp:64
constexpr callable_is_even_ is_even
Returns a logical true if and only if the element value is even.
Definition: is_even.hpp:64
Wrapper for SIMD registers.
Definition: wide.hpp:65