|
inlineconstexpr |
Computes the absolute value of the parameter.
Defined in Header
Parameters
x
: real argument.z
: complex argument .Return value
value containing the elementwise absolute value of x
if it is representable in this type.
More specifically, for signed integers : the absolute value of eve::valmin is not representable and the result is undefined.
eve::hypot(eve::real(z), eve::imag(z))
Real version
Complex version
Masked Call
The call eve;abs[mask](x)
provides a masked version of eve::abs
which is equivalent to if_else (mask, abs(x), x)
.
Example
The call eve::saturated(eve::abs)(x)
computes a saturated version of eve::abs.
More specifically, for any signed integer value x
, the expression eve::saturated(eve::abs)(eve::valmin(as(x)))
evaluates to eve::valmax(as(x))
.
Example
The call eve::pedantic(eve::abs)(z)
computes a pedantic version of the modulus.
More specifically, pedantic(eve::hypot)
is used in place of eve::hypot)
for complex inputs
Example