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

◆ nextint

auto eve::nextint = functor<nextint_t>
inlineconstexpr

This function is equivalent to inc for integral types. For floating point types, it will skip over the non-representable values between the input and the next representable integer.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overloads
constexpr auto nextint(value auto x) noexcept; // 1
// Lanes masking
constexpr auto nextint[conditional_expr auto c](/* any of the above overloads */) noexcept; // 2
constexpr auto nextint[logical_value auto m](/* any of the above overloads */) noexcept; // 2
// Exclusive Semantic options - Only one of those can be set at once
constexpr auto nextint[raw](value auto x) noexcept; // 3
constexpr auto nextint[saturated](value auto x) noexcept; // 4
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:134
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 nextint
Computes the next representable integer if it exists.
Definition nextint.hpp:80
EVE Main Namespace.
Definition abi.hpp:19

Parameters

Return value

  1. the smallest representable integer value greater than x is returned.
  2. The operation is performed conditionnaly
  3. same as 1. but -inf returns nan.
  4. ensures that the input is never greater than the result of the call. (It can be equal for maximal representable value)

Example

#include <eve/eve.hpp>
#include <iostream>
int main()
{
static_cast<eve::float16_t>(-0.0f),
static_cast<eve::float16_t>(0.0f),
static_cast<eve::float16_t>(32768.0f),
static_cast<eve::float16_t>(-32768.0f),
};
std::cout << "<- w = " << w << "\n";
std::cout << "-> nextint(w) = " << eve::nextint(w) << "\n";
std::cout << "-> nextint[saturated](w) = " << eve::nextint[eve::saturated](w) << "\n";
std::cout << "-> nextint[raw](w) = " << eve::nextint[eve::raw](w) << "\n";
eve::wide<std::int16_t, eve::fixed<4>> iw{0, 1, 32767, -32768};
std::cout << "<- iw = " << iw << "\n";
std::cout << "-> nextint(iw) = " << eve::nextint(iw) << "\n";
std::cout << "-> nextint[saturated](iw) = " << eve::nextint[eve::saturated](iw) << "\n";
std::cout << "-> nextint[raw](iw) = " << eve::nextint[eve::raw](iw) << "\n";
}
constexpr auto nan
Computes the IEEE quiet NaN constant.
Definition nan.hpp:67
constexpr auto valmax
Computes the the greatest representable value.
Definition valmax.hpp:67
constexpr auto inf
Computes the infinity ieee value.
Definition inf.hpp:67
Lightweight type-wrapper.
Definition as.hpp:29
Wrapper for SIMD registers.
Definition wide.hpp:94