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

◆ of_class

auto eve::of_class = functor<of_class_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
template<std::uint8_t I, eve::floating_value T>
constexpr auto of_class(value auto x, fp_class<I> i) noexcept;
}
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 of_class
strict_elementwise_callable object computing classification of elements of the input.
Definition of_class.hpp:89
EVE Main Namespace.
Definition abi.hpp:18

Parameters

  • x: value.
  • i: combination of floating point classes to check

Return value

the elementwise logical result of the classification.

Note
The iparameter can be constructed easily by using the values qnan, poszero, negzero, posinf,neginf, denorn,neg, snan defined in the namespace eve and the | operator (see the example below).
name meaning
qnan quiet NaN
poszero positive zero
negzero negative zero
posinf positive infinite
neginf negative infinite
denorm denormal number
neg negative finite
snan signaling NaN

Actually snan and qnan are not distinguished in simd wide.

External references

Example

// revision 0
#include <eve/module/core.hpp>
#include <iostream>
int main()
{
eve::wide wf0{0.0, 1.0, -2.0, nan, inf, mind, inf, -0.0};
std::cout << "<- wf0 = " << wf0 << "\n";
std::cout << "-> of_class(wf0, eve::qnan ) = " << eve::of_class(wf0, eve::qnan ) << "\n";
std::cout << "-> of_class(wf0, eve::poszero) = " << eve::of_class(wf0, eve::poszero) << "\n";
std::cout << "-> of_class(wf0, eve::negzero) = " << eve::of_class(wf0, eve::negzero) << "\n";
std::cout << "-> of_class(wf0, eve::posinf ) = " << eve::of_class(wf0, eve::posinf ) << "\n";
std::cout << "-> of_class(wf0, eve::neginf ) = " << eve::of_class(wf0, eve::neginf ) << "\n";
std::cout << "-> of_class(wf0, eve::denorm ) = " << eve::of_class(wf0, eve::denorm ) << "\n";
std::cout << "-> of_class(wf0, eve::neg ) = " << eve::of_class(wf0, eve::neg ) << "\n";
std::cout << "-> of_class(wf0, eve::snan ) = " << eve::of_class(wf0, eve::snan ) << "\n";
std::cout << "-> of_class(wf0, eve::poszero|eve::negzero|eve::posinf) = " << eve::of_class(wf0, eve::poszero|eve::negzero|eve::posinf) << "\n";
}
constexpr auto nan
Computes the IEEE quiet NaN constant.
Definition nan.hpp:67
constexpr auto mindenormal
Computes the smallest denormal positive value.
Definition mindenormal.hpp:70
constexpr auto inf
Computes the infinity ieee value.
Definition inf.hpp:66
Lightweight type-wrapper.
Definition as.hpp:29
Wrapper for SIMD registers.
Definition wide.hpp:70