E.V.E
v2023.02.15

◆ is_lessgreater

eve::is_lessgreater = {}
inlineconstexpr

Returns a logical true if and only if the elements pair are not equal or unordered.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T, eve::value U >
eve::as_logical<T> is_lessgreater(T x, U y) noexcept;
}
constexpr callable_is_lessgreater_ is_lessgreater
Returns a logical true if and only if the elements pair are not equal or unordered.
Definition: is_lessgreater.hpp:63
Definition: abi.hpp:18

Parameters

Return value

The call eve::is_lessgreater(x, y) is semantically equivalent to x < y || x > y:

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -0.0f, -2.0f};
wide_ft qf = {1.0f, -1.0f, 0.0f, -2.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<< "-> is_lessgreater(pf, qf) = " << eve::is_lessgreater(pf, qf) << '\n';
float xf = 1.0f;
float yf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
<< "-> is_lessgreater(xf, yf) = " << eve::is_lessgreater(xf, yf) << '\n';
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65

Semantic Modifiers

  • Masked Call

    The call eve;is_lessgreater[mask](x, y) provides a masked version of eve::is_lessgreater which is equivalent to if_else (mask, is_lessgreater(x, y), eve::false( eve::as(x))).

    Example

    #include <eve/module/core.hpp>
    #include <eve/wide.hpp>
    #include <iostream>
    int main()
    {
    wide_ft pf = {0.0f, 1.0f, -0.0f, -2.0f};
    wide_ft qf = {1.0f, -1.0f, 0.0f, 2.0f};
    std::cout << "---- simd" << '\n'
    << "<- pf = " << pf << '\n'
    << "<- qf = " << qf << '\n'
    << "-> is_lessgreater[pf > 0](pf, qf) = " << eve::is_lessgreater[pf > 0](pf, qf) << '\n';
    return 0;
    }