E.V.E
v2023.02.15

◆ plus

eve::plus = {}
inlineconstexpr

Computes the opposite of the parameter that must be signed.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
T plus(T x) noexcept;
}
constexpr callable_plus_ plus
Computes the opposite of the parameter that must be signed.
Definition: plus.hpp:54
Definition: abi.hpp:18

Parameters

Return value

Returns x

Note
Although the operator notation with + is supported, the + operator on standard scalar type is the original one and so can lead to automatic promotion.

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {-1.0f, 2.0f, -3.0f, -32768.0f};
wide_it pi = {-1, 2, -3, -32768};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> plus(pf) = " << eve::plus(pf) << '\n'
<< "<- pi = " << pi << '\n'
<< "-> plus(pi) = " << eve::plus(pi) << '\n';
float xf = -32768.0f;
std::int16_t xi = -32768;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> plus(xf) = " << eve::plus(xf) << '\n'
<< "<- xi = " << xi << '\n'
<< "-> plus(xi) = " << eve::plus(xi) << '\n';
return 0;
}
constexpr callable_pi_ pi
Callable object computing the constant .
Definition: pi.hpp:49
Wrapper for SIMD registers.
Definition: wide.hpp:65