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

◆ next

auto eve::next = functor<next_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overloads
constexpr auto next(value auto x) noexcept; // 1
constexpr auto next(value auto x, integral_value auto n) noexcept; // 2
// Lanes masking
constexpr auto next[conditional_expr auto c](/* any of the above overloads */) noexcept; // 3
constexpr auto next[logical_value auto m](/* any of the above overloads */) noexcept; // 3
// Exclusive Semantic options - Only one of those can be set at once
constexpr auto next[pedantic](/* any of the above overloads */) noexcept; // 5.1
constexpr auto next[saturated ](/* any of the above overloads */) noexcept; // 5.2
constexpr auto next[raw](value auto x) noexcept; // 6
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept integral_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:51
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:132
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 next
strict_elementwise_callable computing the nth next representable element
Definition next.hpp:98
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. the least representable value greater than x is returned.
  2. the nth representable value greater than x is returned. If n is zero returns x.
  3. The operation is performed conditionnaly
  4. if x is floating the call with mzero returns zero
  5. ensures that the input is never greater than the result of the call.
  6. works only if inputs are normal numbers (this excludes floating zeroes, denormals or not finite) the option has no influence on the two parameters calls

If n is zero returns x.

Example

// revision 0
#include <eve/module/core.hpp>
#include <iostream>
#include <iomanip>
int main()
{
eve::wide wf0 = {-0.0f, 2.0f, eve::eps(eve::as<float>()), 0.0f, 30.0f,eve::mindenormal(eve::as<float>()),
eve::wide wi0 = {-1, 2, -3, -4, 327654, 32765, 32766, 32767 };
eve::wide wu0 = {0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u};
std::cout << std::hexfloat;
std::cout << "<- wf0 = " << wf0 << "\n";
std::cout << "<- wi0 = " << wi0 << "\n";
std::cout << "<- wu0 = " << wu0 << "\n";
std::cout << "-> next(wf0) = " << eve::next(wf0) << "\n";
std::cout << "-> next(wf0, wi1) = " << eve::next(wf0, wu0) << "\n";
std::cout << "-> next[ignore_last(2)](wf0) = " << eve::next[eve::ignore_last(2)](wf0) << "\n";
std::cout << "-> next[wf0 != 0](wf0) = " << eve::next[wf0 != 0](wf0) << "\n";
std::cout << "-> next[pedantic](wf0) = " << eve::next[eve::pedantic](wf0) << "\n";
std::cout << "-> next[saturated ](wi0) = " << eve::next[eve::saturated ](wi0) << "\n";
std::cout << "-> next(wu0) = " << eve::next(wu0) << "\n";
std::cout << "-> next(wi0) = " << eve::next(wi0) << "\n";
std::cout << "-> next(wi0, wu0) = " << eve::next(wi0, wu0) << "\n";
}
constexpr auto nan
Computes the IEEE quiet NaN constant.
Definition nan.hpp:67
constexpr auto eps
Computes a constant to the machine epsilon.
Definition eps.hpp:73
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
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:332
Wrapper for SIMD registers.
Definition wide.hpp:70