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

◆ nb_values

eve::nb_values = functor<nb_values_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T, eve::value U >
as_integer_t<common_value_t<T, U>, unsigned> nb_values(T x, T y) noexcept;
}
constexpr auto nb_values
Computes the number of values representable in the type between the arguments.
Definition: nb_values.hpp:67
EVE Main Namespace.
Definition: abi.hpp:18

Parameters

Return value

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

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
int main()
{
w_t pi = {0.0f, 1.0f, 1.0f-eve::eps(eve::as<float>())/2, 1.0f };
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 auto eps
Computes a constant to the machine epsilon.
Definition: eps.hpp:76
constexpr auto smallestposval
Computes the smallest normal positive value.
Definition: smallestposval.hpp:74
constexpr auto inf
Computes the infinity ieee value.
Definition: inf.hpp:70
constexpr auto pi
Callable object computing the constant .
Definition: pi.hpp:77
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65