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

◆ exponent

auto eve::exponent = functor<exponent_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto exponent(floating_value auto x) noexcept; // 1
// Semantic options
constexpr auto exponent[raw](floating_value auto x) noexcept; // 2
}
The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:116
constexpr auto exponent
elementwise_callable object computing the integral IEEE exponent of the floating value.
Definition exponent.hpp:80
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. The value of the IEEE exponent is returned. In particular:
    • inf, minf and nan return maxexponent plus 1
    • zero returns zero 2 identical except that results for zero, nan and infinite inputs are unspecified
Note
The exponent \(e\) and mantissa \(m\) of a floating point entry \(x\) are related by \(x = m\times 2^e\), with \(|m| \in \{0\} \cup [1, 2[\).

Example

// revision 0
#include <eve/module/core.hpp>
#include <iostream>
int main()
{
eve::wide wf0{0.0, 1.0, 2.0, 3.0, -1.0, -2.0, -3.0, -4.0};
std::cout << "<- wf0 = " << wf0 << "\n";
std::cout << "-> exponent(wf0) = " << eve::exponent(wf0) << "\n";
std::cout << "-> exponent[raw](wf0) = " << eve::exponent[eve::raw](wf0) << "\n";
}
Wrapper for SIMD registers.
Definition wide.hpp:86