E.V.E  0.1-beta

◆ nb_values

eve::nb_values = {}
inlineconstexpr

Callable object computing the nb_values operation.

Required header: #include <eve/function/nb_values.hpp>

Members Functions

Member Effect
operator() the nb_values operation

template< value T, value U > auto operator()( T x, U y ) const noexcept requires compatible< T, U >;

Parameters

x, y: values.

Return value

computes the number of values representable in the type in the interval [x, y[


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/nb_values.hpp>
#include <eve/constant/eps.hpp>
#include <eve/constant/inf.hpp>
#include <eve/wide.hpp>
#include <iomanip>
#include <iostream>
int main()
{
w_t pi = {0.0f, 1.0f, 1.0f-eve::eps(eve::as<float>()), 1.0f};
w_t qi = {1.0f, 2.0f, 1.0f, eve::inf(eve::as<float>())};
std::cout << "---- simd" << std::setprecision(9) << '\n'
<< " <- pi = " << pi << '\n'
<< " <- qi = " << qi << '\n'
<< " -> nb_values(pi, qi) = " << eve::nb_values(pi, qi) << '\n';
std::uint32_t xi = 3, yi = 7;
std::cout << "---- scalar" << '\n'
<< " xi = " << xi << '\n'
<< " yi = " << yi << '\n'
<< " -> nb_values(xi, yi) = " << eve::nb_values(xi, yi) << '\n';
return 0;
}
constexpr callable_eps_ eps
Callable object computing the machine epsilon.
Definition: eps.hpp:60
constexpr callable_pi_ pi
Callable object computing the value.
Definition: pi.hpp:54
constexpr callable_inf_ inf
Callable object computing the infinity ieee value.
Definition: inf.hpp:54
constexpr callable_nb_values_ nb_values
Callable object computing the nb_values operation.
Definition: nb_values.hpp:59
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65