E.V.E
v2023.02.15

Detailed Description

Computes a floating constant from its scalar hexadecimal integral representation.

Basic useful constants (scalar and SIMD)

All EVE constants can be called in two ways:

Where ct denotes the constant name.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T, auto BitsPattern >
T constant(as<T> x) noexcept;
}
Definition: abi.hpp:18

Parameters

Return value

The call eve::constant<Bitpattern>(as<T>()) returns a value of type T from the bits found in Bitpattern.

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
using wide_ft = eve::wide<float>;
using wide_dt = eve::wide<double>;
int main()
{
std::cout << "---- simd" << std::setprecision(15) << std::endl
<< "-> Constant<wide_ft, 0X3F1DE9E7U>() " << eve::Constant<wide_ft, 0X3F1DE9E7U>()<< std::endl
<< "-> Constant<wide_dt, 0x3FE3BD3CC9BE45DEULL>() " << eve::Constant<wide_dt, 0x3FE3BD3CC9BE45DEULL>()<< std::endl;
std::cout << "---- scalar" << std::endl
<< "-> Constant<float, 0X3F1DE9E7U>() " << eve::Constant<float, 0X3F1DE9E7U>()<< std::endl
<< "-> Constant<double, 0x3FE3BD3CC9BE45DEULL>() " << eve::Constant<double, 0x3FE3BD3CC9BE45DEULL>()<< std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65

Variables

constexpr callable_allbits_ eve::allbits = {}
 Computes the constant with all bits set. More...
 
constexpr callable_bitincrement_ eve::bitincrement = {}
 Computes the constant of type T in which the only bit set is the least significant. More...
 
constexpr callable_eps_ eve::eps = {}
 Computes the the machine epsilon. More...
 
constexpr callable_exponentmask_ eve::exponentmask = {}
 Computes the the exponent bit mask of IEEE float or double. More...
 
constexpr callable_false__ eve::false_ = {}
 Computes the false logical value. More...
 
constexpr callable_half_ eve::half = {}
 Computes the constant \(1/2\). More...
 
constexpr callable_inf_ eve::inf = {}
 Computes the infinity ieee value. More...
 
constexpr callable_logeps_ eve::logeps = {}
 Computes the natural logarithm of the machine epsilon. More...
 
constexpr callable_mantissamask_ eve::mantissamask = {}
 Computes the mask to extract the mantissa bits of an ieee floating value. More...
 
constexpr callable_maxexponent_ eve::maxexponent = {}
 Computes the the greatest exponent of a floating point IEEE value. More...
 
constexpr callable_maxexponentm1_ eve::maxexponentm1 = {}
 Computes the the greatest exponent of a floating point IEEE value minus one. More...
 
constexpr callable_maxexponentp1_ eve::maxexponentp1 = {}
 Computes the the greatest exponent of a floating point IEEE value plus one. More...
 
constexpr callable_maxflint_ eve::maxflint = {}
 Computes the the greatest floating point representing an integer and such that n != n+1. More...
 
constexpr callable_mhalf_ eve::mhalf = {}
 Computes the constant \(-1/2\). More...
 
constexpr callable_mindenormal_ eve::mindenormal = {}
 Computes the smallest denormal positive value. More...
 
constexpr callable_minexponent_ eve::minexponent = {}
 Computes the the greatest exponent of a floating point IEEE value. More...
 
constexpr callable_minf_ eve::minf = {}
 Computes the -infinity ieee value. More...
 
constexpr callable_mone_ eve::mone = {}
 Computes the constant \(-1\). More...
 
constexpr callable_mzero_ eve::mzero = {}
 Computes the negative zero value. More...
 
constexpr callable_nan_ eve::nan = {}
 Computes the IEEE NaN constant. More...
 
constexpr callable_nbmantissabits_ eve::nbmantissabits = {}
 Returns the number of mantissa bits of a floating point value. More...
 
constexpr callable_one_ eve::one = {}
 Computes the constant \(1\). More...
 
constexpr callable_oneosqrteps_ eve::oneosqrteps = {}
 Computes the the inverse of the square root of the machine epsilon. More...
 
constexpr callable_signmask_ eve::signmask = {}
 Computes a value in which the most significant bit is the only bit set. More...
 
constexpr callable_smallestposval_ eve::smallestposval = {}
 Computes the smallest normal positive value. More...
 
constexpr callable_sqrteps_ eve::sqrteps = {}
 Computes the square root of the machine epsilon. More...
 
constexpr callable_sqrtsmallestposval_ eve::sqrtsmallestposval = {}
 Computes the square root of the eve::smallestposval. More...
 
constexpr callable_sqrtvalmax_ eve::sqrtvalmax = {}
 Computes the the greatest value less than the square root of eve::valmax. More...
 
constexpr callable_true__ eve::true_ = {}
 Computes the logical true_ value. More...
 
constexpr callable_twotonmb_ eve::twotonmb = {}
 Computes the 2 power of the number of mantissa bits of a floating value. More...
 
constexpr callable_valmax_ eve::valmax = {}
 Computes the the greatest representable value. More...
 
constexpr callable_valmin_ eve::valmin = {}
 Computes the the lowest representable value. More...
 
constexpr callable_zero_ eve::zero = {}
 Computes the constant 0. More...