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

◆ log_2

auto eve::log_2 = functor<log_2_t>
inlineconstexpr

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
T log_2(as<T> x) noexcept;
}
constexpr auto log_2
Callable object computing the constant .
Definition log_2.hpp:77
EVE Main Namespace.
Definition abi.hpp:18
Lightweight type-wrapper.
Definition as.hpp:29

Parameters

  • x : Type wrapper instance embedding the type of the constant.

Return value

The call eve::log_2(as<T>()) returns \(\log 2\).

Example

#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
using wide_ft = eve::wide<float>;
template<typename T>
consteval auto constexpr_log_2() { return eve::log_2(eve::as<T>{}); }
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::setprecision(9) << std::endl
<< "-> log2_e(as<wide_ft>()) = " << eve::log2_e(eve::as<wide_ft>()) << std::endl
<< "-> log2_e(as(wxf)) = " << eve::log2_e(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> log2_e(as<float>()) = " << eve::log2_e(eve::as(float())) << std::endl
<< "-> log2_e(as<xf)) = " << eve::log2_e(eve::as(xf)) << std::endl;
std::cout << "-> constexpr log_2 = " << constexpr_log_2<float>() << std::endl;
return 0;
}
constexpr auto log2_e
Callable object computing the constant .
Definition log2_e.hpp:77
Wrapper for SIMD registers.
Definition wide.hpp:70