E.V.E
v2022.03.00

◆ uint8

eve::uint8 = {}
inlineconstexpr

convert a eve::value to a std::uint8_t based eve::value.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
as_wide_as<T, std::uint8_t> uint8(T x) noexcept; //1
template< eve::callable C >
as_wide_as<T, std::uint8_t> uint8(C x) noexcept; //2
}
constexpr converter_type< std::uint8_t > const uint8
convert a eve::value to a std::uint8_t based eve::value.
Definition: converter.hpp:221
Definition: all_of.hpp:22

Parameters

  • x : argument.

Return value

  • if x is an eve::simd_value, returns a value, of type wide <std::uint8_t, cardinal_t<T>>,
  • if x is an eve::scalar_value, returns a value of type std::uint8_t,
  • if x is a supported callable a call to uint8(x)(...) is semantically equivalent to uint8(x(...)).

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {-1.0f, 2.3f, 45000.7f, -10.6f};
wide_it pi = {-1, 2, 100, eve::valmax(eve::as<std::int64_t>())};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> uint8(pf) = " << eve::uint8(pf) << '\n'
<< "<- pi = " << pi << '\n'
<< "-> uint8(pi) = " << eve::uint8(pi) << '\n';
return 0;
}
constexpr callable_valmax_ valmax
Computes the the greatest representable value.
Definition: valmax.hpp:55
constexpr callable_pi_ pi
Callable object computing the constant .
Definition: pi.hpp:49
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65