E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ quadrant

auto eve::quadrant = functor<quadrant_t>
inlineconstexpr

Header file

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
constexpr auto quadrant(value auto n) noexcept; // 1
}
The concept value<T> is satisfied if and only if T satisfies either eve::scalar_value or eve::simd_va...
Definition value.hpp:34
constexpr auto quadrant
Callable object computing the quadrant value.
Definition quadrant.hpp:59
EVE Main Namespace.
Definition abi.hpp:18

Parameters

n: value. Must be of integral type or a flint

Return value

return a value of the same type as n containing the quadrant number where n (supposed an integer) lies.

Example

// revision 1
#include <eve/module/math.hpp>
#include <iostream>
eve::wide<float> wf([](auto i, auto c)->float{ return 2*(i-c/2);});
eve::wide<std::int32_t> wi([](auto i, auto c)->std::int32_t{ return i-c/2;});
eve::wide<std::uint32_t> wu([](auto i, auto )->std::uint32_t{ return i;});
int main()
{
std::cout << "<- wf = " << wf << "\n";
std::cout << "<- wi = " << wi << "\n";
std::cout << "<- wu = " << wu << "\n";
std::cout << "-> quadrant(wf)= " << eve::quadrant(wf) << "\n";
std::cout << "-> quadrant(wi)= " << eve::quadrant(wi) << "\n";
std::cout << "-> quadrant(wu)= " << eve::quadrant(wu) << "\n";
}
Wrapper for SIMD registers.
Definition wide.hpp:70