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

◆ ilogb

auto eve::ilogb = functor<ilogb_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
template < floating_value T> constexpr as_integer_t<T> ilogb(T x) noexcept;
constexpr auto ilogb
elementwise_callable object computing the integral IEEE ilogb of the floating value.
Definition ilogb.hpp:69
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

The spirit of the value of the std::ilogb is returned. In particular:

  • zero and nan return valmin(as<as_integer_t<T>>()).
  • inf and minfreturn valmax(as<as_integer_t<T>>()).

Example

// revision 1
#include <eve/module/math.hpp>
#include <iostream>
int main()
{
eve::wide wd = {0.0, -1.0, 8.0, 1.5, 2.0, 16.0, 15.3, 17.2};
std::cout << "<- wd = " << wd << "\n";
std::cout << "-> ilogb(wd) = " << eve::ilogb(wd) << "\n";
std::cout << "-> ilogb[ignore_last(2)](wd)= " << eve::ilogb[eve::ignore_last(2)](wd) << "\n";
std::cout << "-> ilogb[wd != 2.0](wd) = " << eve::ilogb[wd != 2.0](wd) << "\n";
}
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:332
Wrapper for SIMD registers.
Definition wide.hpp:70