E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
arg
auto eve::arg =
functor
<arg_t>
inline
constexpr
Callable Signatures
#include <eve/module/math.hpp>
Callable Signatures
namespace
eve
{
// Regular overload
constexpr
auto
arg
(
floating_value
auto
x)
noexcept
;
// 1
// Lanes masking
constexpr
auto
arg
[
conditional_expr
auto
c](
value
auto
x)
noexcept
;
// 2
constexpr
auto
arg
[
logical_value
auto
m](
value
auto
x)
noexcept
;
// 2
// Semantic option
constexpr
auto
arg
[pedantic](
floating_value
auto
x)
noexcept
;
// 3
constexpr
auto
arg
[rad](
floating_value
auto
x)
noexcept
;
// 1
constexpr
auto
arg
[deg](
floating_value
auto
x)
noexcept
;
// 4
constexpr
auto
arg
[pirad](
floating_value
auto
x)
noexcept
;
// 5
}
eve::conditional_expr
Specifies that a type is a Conditional Expression.
Definition
conditional.hpp:28
eve::floating_value
The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition
value.hpp:116
eve::logical_value
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition
value.hpp:134
eve::value
The concept value<T> is satisfied if and only if T satisfies either eve::scalar_value or eve::simd_va...
Definition
value.hpp:34
eve::arg
constexpr auto arg
elementwise_callable object computing the phase angle (in radians).
Definition
arg.hpp:83
eve
EVE Main Namespace.
Definition
abi.hpp:19
Parameters
x
:
floating value
argument.
c
:
Conditional expression
masking the operation.
m
:
Logical value
masking the operation.
Return value
Returns
elementwise
the phase angle (in radians) of the input (0 or \(\pi\)) depending of the bit of sign of the input
The operation is performed conditionnaly
.
If the entry is
NaN
the result is
NaN
.
Result in degrees
Result in \(\pi\) multiples
Note
phase can be used as an alias
External references
C++ standard reference
Example
// revision 1
#include <eve/module/math.hpp>
#include <iostream>
int
main()
{
eve::wide
wf = { 0.0f, -0.0f, 1.0f, -1.0f,
-0.5f, 0.5f,
eve::inf
(
eve::as<float>
()),
eve::nan
(
eve::as<float>
())};
std::cout <<
"<- wf = "
<< wf <<
"\n"
;
std::cout <<
"-> arg(wf) = "
<<
eve::arg
(wf) <<
"\n"
;
std::cout <<
"-> arg[deg](wf) = "
<<
eve::arg
[eve::deg](wf) <<
"\n"
;
std::cout <<
"-> arg[radpi](wf) = "
<<
eve::arg
[eve::radpi](wf) <<
"\n"
;
std::cout <<
"-> arg[rad](wf) = "
<<
eve::arg
[eve::rad](wf) <<
"\n"
;
std::cout <<
"-> arg[pedantic](wf) = "
<<
eve::arg
[eve::pedantic](wf) <<
"\n"
;
std::cout <<
"-> arg[ignore_last(2)](wf) = "
<<
eve::arg
[
eve::ignore_last
(2)](wf) <<
"\n"
;
std::cout <<
"-> arg[wf != 0.5f](wf) = "
<<
eve::arg
[wf != 0.5f](wf) <<
"\n"
;
}
eve::nan
constexpr auto nan
Computes the IEEE quiet NaN constant.
Definition
nan.hpp:67
eve::inf
constexpr auto inf
Computes the infinity ieee value.
Definition
inf.hpp:67
eve::as
Lightweight type-wrapper.
Definition
as.hpp:29
eve::ignore_last
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition
conditional.hpp:353
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:94
eve