E.V.E
v2023.02.15

◆ uint16

eve::uint16 = {}
inlineconstexpr

convert a eve::value to a std::uint16_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::uint16_t> uint16(T x) noexcept; //1
template< eve::callable C >
as_wide_as<T, std::uint16_t> uint16(C x) noexcept; //2
}
constexpr converter_type< std::uint16_t > const uint16
convert a eve::value to a std::uint16_t based eve::value.
Definition: converter.hpp:267
Definition: abi.hpp:18

Parameters

  • x : argument.

Return value

  • if x is an eve::simd_value, returns a value, of typewide <std::uint16_t, cardinal_t<T>>,
  • if x is an eve::scalar_value, returns a value of type std::uint16_t,
  • if x is a supported callable a call to uint16(x)(...) is semantically equivalent to uint16(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, -3, eve::valmax(eve::as<std::int64_t>())};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> uint16(pf) = " << eve::uint16(pf) << '\n'
<< "<- pi = " << pi << '\n'
<< "-> uint16(pi) = " << eve::uint16(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