E.V.E
v2022.03.00

◆ float32

eve::float32 = {}
inlineconstexpr

convert a eve::value to a float32 based eve::floating_value.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

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

Parameters

  • x : argument.

Return value

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

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_64t p64 = {1, 2, 100, eve::valmax(eve::as<std::int64_t>())};
std::cout << "---- simd" << '\n'
<< "<- p64 = " << p64 << '\n'
<< "-> float32(p64) = " << eve::float32(p64) << '\n';
return 0;
}
constexpr callable_valmax_ valmax
Computes the the greatest representable value.
Definition: valmax.hpp:55
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65