◆ sub
Callable object performing the difference of multiple values. Required header: Members Functions
Definition: value.hpp:31 Parameters
Return value A value of the common compatible type of all auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::sub Parameters
Return value A Callable object so that the expression Supported decorators
ExampleSee it live on Compiler Explorer #include <eve/function/sub.hpp>
#include <eve/function/saturated/sub.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using w_t = eve::wide<std::int16_t, eve::fixed<4>>;
w_t pi = {3, 2, -32700, 32700}, qi = {4, 1, 100, -100};
std::cout << "---- simd" << '\n'
<< " <- qi = " << qi << '\n'
std::int16_t xi = 100, yi = 32700;
std::cout << "---- scalar" << '\n'
<< " <- xi = " << xi << '\n'
<< " <- yi = " << yi << '\n'
<< " -> xi + yi = " << xi + yi << '\n'; // C++ promotion to int
std::cout << "---- multi parameters" << '\n'
return 0;
}
constexpr callable_sub_ sub Callable object performing the difference of multiple values. Definition: sub.hpp:88 constexpr saturated_type const saturated Higher-order Callable Object imbuing saturation semantic onto other Callable Objects. Definition: saturated.hpp:68 |