E.V.E
v2023.02.15

◆ floating_

eve::floating_ = {}
inlineconstexpr

convert a eve::value to an eve::floating_value.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
as_wide_as<T, eve::as_floating_point_t<T>> floating_(T x) noexcept; //1
template< eve::callable C >
as_wide_as<T, , eve::as_floating_point_t<T>> floating_(C x) noexcept; //2
}
constexpr floating_converter const floating_
convert a eve::value to an eve::floating_value.
Definition: converter.hpp:693
Definition: abi.hpp:18

Parameters

  • x : argument.

Return value

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

where i_t is eve::as_floating_point_t<eve::element_type_t<T>>

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_8t p8 = {-1, -3, 6, 127};
wide_64t p64 = {1, 2, 100, eve::valmax(eve::as<std::int64_t>())};
std::cout << "---- simd" << '\n'
<< "<- p8 = " << p8 << '\n'
<< "-> floating_(p8) = " << eve::floating_(p8) << '\n'
<< "<- p64 = " << p64 << '\n'
<< "-> floating_(p64) = " << eve::floating_(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