Builds a floating-point constant from the exact representation it must take in each precision.
Basic useful constants (scalar and SIMD)
All EVE constants can be called in four ways:
Here ct denotes the constant name.
When the condition is present and evaluate to false the result element default to zero, but this behavior can be changed if the condition is expressed by an if_(...).else_(...) clause.
Template Parameters
Parameters
Return value
Variables | |
| constexpr auto | eve::allbits = functor<allbits_t> |
| Computes a constant with all bits set. | |
| constexpr auto | eve::bitincrement = functor<bitincrement_t> |
| Computes a constant with only the least significant bit set. | |
| constexpr auto | eve::eps = functor<eps_t> |
| Computes a constant to the machine epsilon. | |
| constexpr auto | eve::exponentmask = functor<exponentmask_t> |
| Computes the exponent bit mask of IEEE float or double. | |
| constexpr auto | eve::false_ = functor<false_t> |
| Computes the false logical value. | |
| constexpr auto | eve::half = functor<half_t> |
| Computes the constant \(1/2\). | |
| constexpr auto | eve::inf = functor<inf_t> |
| Computes the infinity ieee value. | |
| constexpr auto | eve::iota = functor<iota_t> |
| all numbers from 0 to size() - 1. equivalent to T{ [](int i, int) {return i; } } | |
| constexpr auto | eve::logeps = functor<logeps_t> |
| Computes the natural logarithm of the machine epsilon. | |
| constexpr auto | eve::majorant = functor<majorant_t> |
| Computes a value x such that for any value y of the same type, is_not_greater(y, x) is true. | |
| constexpr auto | eve::mantissamask = functor<mantissamask_t> |
| Computes the mask to extract the mantissa bits of an ieee floating value. | |
| constexpr auto | eve::max_safe_integer = functor<max_safe_integer_t> |
| Computes the greatest floating point representing an integer such that n != n+1. | |
| constexpr auto | eve::maxexponent = functor<maxexponent_t> |
| Computes the greatest exponent of a floating point IEEE value. | |
| constexpr auto | eve::maxexponentm1 = functor<maxexponentm1_t> |
| Computes the greatest exponent of a floating point IEEE value minus one. | |
| constexpr auto | eve::maxexponentp1 = functor<maxexponentp1_t> |
| Computes the greatest exponent of a floating point IEEE value plus one. | |
| constexpr auto | eve::maxflint = functor<maxflint_t> |
| Computes the smallest floating point representing an integer such that n == n+1. | |
| constexpr auto | eve::maxrepint = functor<maxrepint_t> |
| Computes the maximum representable integer value. Same as maxflint for floating types and valmax for integral types. | |
| constexpr auto | eve::mhalf = functor<mhalf_t> |
| Computes the constant \(-1/2\). | |
| constexpr auto | eve::mindenormal = functor<mindenormal_t> |
| Computes the smallest denormal positive value. | |
| constexpr auto | eve::minexponent = functor<minexponent_t> |
| Computes the least exponent of a floating point IEEE value. | |
| constexpr auto | eve::minf = functor<minf_t> |
| Computes the -infinity ieee value. | |
| constexpr auto | eve::minorant = functor<minorant_t> |
| Computes a value x such that for any value y of the same type, is_not_less(y, x) is true. | |
| constexpr auto | eve::mone = functor<mone_t> |
| Computes the constant \(-1\). | |
| constexpr auto | eve::mzero = functor<mzero_t> |
| Computes the negative zero value. | |
| constexpr auto | eve::nan = functor<nan_t> |
| Computes the IEEE quiet NaN constant. | |
| constexpr auto | eve::nbmantissabits = functor<nbmantissabits_t> |
| Returns the number of mantissa bits of a floating point value. | |
| constexpr auto | eve::one = functor<one_t> |
| Computes the constant \(1\). | |
| constexpr auto | eve::oneosqrteps = functor<oneosqrteps_t> |
| Computes the inverse of the square root of the machine epsilon. | |
| constexpr auto | eve::signmask = functor<signmask_t> |
| Computes a value in which the most significant bit is the only bit set. | |
| constexpr auto | eve::smallestposval = functor<smallestposval_t> |
| Computes the smallest normal positive value. | |
| constexpr auto | eve::sqrteps = functor<sqrteps_t> |
| Computes the square root of the machine epsilon. | |
| constexpr auto | eve::sqrtsmallestposval = functor<sqrtsmallestposval_t> |
| Computes the square root of the eve::smallestposval. | |
| constexpr auto | eve::sqrtvalmax = functor<sqrtvalmax_t> |
| Computes the greatest value less than the square root of eve::valmax. | |
| constexpr auto | eve::true_ = functor<true_t> |
| Computes the logical true_ value. | |
| constexpr auto | eve::twotonmb = functor<twotonmb_t> |
| Computes the 2 power of the number of mantissa bits of a floating value. | |
| constexpr auto | eve::valmax = functor<valmax_t> |
| Computes the greatest representable value. | |
| constexpr auto | eve::valmin = functor<valmin_t> |
| Computes the lowest representable value. | |
| constexpr auto | eve::zero = functor<zero_t> |
| Computes the constant 0. | |
| constexpr auto | eve::oneotwoeps = functor<oneotwoeps_t> |
| Computes a constant to the machine oneotwoepsilon. | |
|
inlineconstexpr |
Computes a constant with all bits set.
Defined in Header
Parameters
Return value
The call eve::allbits(as<T>()) returns a value of type T with all bits set.
|
inlineconstexpr |
Computes a constant with only the least significant bit set.
Defined in Header
Parameters
Return value
The call eve::bitincrement(as<T>()) returns a value of type T with only the least significant bit set.
|
inlineconstexpr |
Computes a constant to the machine epsilon.
Defined in Header
Parameters
Return value
The call eve::eps(as<T>()) returns elementwise, the smallest positive value x of the type such that 1+x != x.
|
inlineconstexpr |
Computes the exponent bit mask of IEEE float or double.
Defined in Header
Parameters
t: Type wrapper instance embedding the type of the constant.
Return value
the call eve::exponentmask(as<T>()) returns elementwise, the integral mask to extract the exponent bits of an ieee floating value. The element values are:
|
inlineconstexpr |
Computes the false logical value.
Defined in Header
Parameters
Return value
The call eve::false_(as<T>()) returns the false logical value for type T.
|
inlineconstexpr |
Computes the constant \(1/2\).
Defined in Header
Parameters
x : Type wrapper instance embedding the type of the constant.
Return value
The call eve::half(as<T>()) is semantically equivalent to T(0.5).
|
inlineconstexpr |
Computes the infinity ieee value.
Defined in Header
Parameters
Return value
The call eve::inf(as<T>()) is semantically equivalent to T(std::numeric_limits<eve::element_type_t<T>>::``infinity())
|
inlineconstexpr |
all numbers from 0 to size() - 1. equivalent to T{ [](int i, int) {return i; } }
Defined in Header
Parameters
Return value
|
inlineconstexpr |
Computes the natural logarithm of the machine epsilon.
Defined in Header
Parameters
Return value
The call eve::logeps(as<T>()) is semantically equivalent to eve::log (eve::eps (eve::as<T>())).
|
inlineconstexpr |
Computes a value x such that for any value y of the same type, is_not_greater(y, x) is true.
Defined in Header
Parameters
Return value
The call eve::majorant(as<T>()) is semantically equivalent to valmax for integral types and inf for floating-point types.
|
inlineconstexpr |
Computes the mask to extract the mantissa bits of an ieee floating value.
Defined in Header
Parameters
Return value
The call eve::mantissamask(as<T>()) returns elementwise, the integral mask to extract the mantissa bits of an ieee floating value. The element values are:
|
inlineconstexpr |
Computes the greatest floating point representing an integer such that n != n+1.
Defined in Header
Parameters
Return value
The call eve::max_safe_integer(as<T>()) is semantically equivalent to:
|
inlineconstexpr |
Computes the greatest exponent of a floating point IEEE value.
Defined in Header
Parameters
Return value
the call eve::maxexponent(as<T>()) is semantically equivalent to
|
inlineconstexpr |
Computes the greatest exponent of a floating point IEEE value minus one.
Defined in Header
Parameters
Return value
the call eve::maxexponentm1(as<T>()) is semantically equivalent to
|
inlineconstexpr |
Computes the greatest exponent of a floating point IEEE value plus one.
Defined in Header
Parameters
Return value
the call eve::maxexponentp1(as<T>()) is semantically equivalent to
|
inlineconstexpr |
Computes the smallest floating point representing an integer such that n == n+1.
Defined in Header
Parameters
Return value
The call eve::maxflint(as<T>()) is semantically equivalent to:
|
inlineconstexpr |
Computes the maximum representable integer value. Same as maxflint for floating types and valmax for integral types.
Defined in Header
Parameters
Return value
The call eve::maxrepint(as<T>{}) is semantically equivalent to:
|
inlineconstexpr |
Computes the constant \(-1/2\).
Defined in Header
Parameters
x : Type wrapper instance embedding the type of the constant.
Return value
The call eve::mhalf(as<T>()) is semantically equivalent to T(-0.5).
|
inlineconstexpr |
Computes the smallest denormal positive value.
Defined in Header
Parameters
Return value
The call eve::mindenormal(as<T>()) is semantically equivalent to:
|
inlineconstexpr |
Computes the least exponent of a floating point IEEE value.
Defined in Header
Parameters
Return value
The call eve::minexponent(as<T>()) is semantically equivalent to
|
inlineconstexpr |
Computes the -infinity ieee value.
Defined in Header
Parameters
Return value
The call eve::minf(as<T>()) is semantically equivalent to T(-std::numeric_limits<eve::element_type_t<T>>::infinity())
|
inlineconstexpr |
Computes a value x such that for any value y of the same type, is_not_less(y, x) is true.
Defined in Header
Parameters
Return value
The call eve::minorant(as<T>()) is semantically equivalent to valmin for integral types and minf for floating-point types.
|
inlineconstexpr |
Computes the constant \(-1\).
Defined in Header
Parameters
Return value
The call eve::mone(as<T>()) is semantically equivalent to T(-1)
|
inlineconstexpr |
Computes the negative zero value.
For integral type there is no difference between eve::zero and eve::mzero, but for floating ones the bit of sign differs.
However, eve::mzero always satisfies the equality predicate with eve::zero and eve::mzero satisfies the predicate is_negative, but not the predicate is_ltz.
Defined in Header
Parameters
Return value
The call eve::mzero(as<T>()) is semantically equivalent to T(-0.0).
|
inlineconstexpr |
Computes the IEEE quiet NaN constant.
Defined in Header
Parameters
Return value
The call eve::nan(as<T>()) is semantically equivalent to T(0.0/0.0).
|
inlineconstexpr |
Returns the number of mantissa bits of a floating point value.
Defined in Header
Parameters
Return value
The call eve::nbmantissabits(as<T>()) is semantically equivalent to:
|
inlineconstexpr |
Computes the constant \(1\).
Defined in Header
Parameters
Return value
The call eve::one(as<T>()) is semantically equivalent to T(1)
|
inlineconstexpr |
Computes the inverse of the square root of the machine epsilon.
Defined in Header
Parameters
Return value
The call eve::oneosqrteps(as<T>()) is semantically equivalent to eve::rec (eve::sqrt (eve::eps (as<T>())))
|
inlineconstexpr |
Computes a constant to the machine oneotwoepsilon.
Defined in Header
Parameters
Return value
The call eve::oneotwoeps(as<T>()) returns elementwise, the smallest positive value x of the type such that 1+x != x.
|
inlineconstexpr |
Computes a value in which the most significant bit is the only bit set.
Defined in Header
Parameters
Return value
The call eve::signmask(as<T)) returns a value of type T for which each element has all its bits unset except the highest.
|
inlineconstexpr |
Computes the smallest normal positive value.
Defined in Header
Parameters
Return value
The call eve::smallestposval(as<T>()) is semantically equivalent to:
|
inlineconstexpr |
Computes the square root of the machine epsilon.
Defined in Header
Parameters
Return value
The call eve::sqrteps(as<T>()) is semantically equivalent to eve::sqrt (eve::eps (as<T>()))
|
inlineconstexpr |
Computes the square root of the eve::smallestposval.
Defined in Header
Parameters
Return value
The call eve::sqrtsmallestposval(as<T>()) is semantically equivalent to eve::sqrt (eve::smallestposval(as<T>()).
|
inlineconstexpr |
Computes the greatest value less than the square root of eve::valmax.
Defined in Header
Parameters
Return value
The call eve::sqrtvalmax(as<T>()) is the greatest number of the type whose square is less or equal to eve::valmax(as<T>()).
|
inlineconstexpr |
Computes the logical true_ value.
Defined in Header
Parameters
Return value
The call eve::true_(as<T>()) returns elementwise, the true logical value.
|
inlineconstexpr |
Computes the 2 power of the number of mantissa bits of a floating value.
Defined in Header
Parameters
Return value
The call eve::twotonmb(as<T>()) is semantically equivalent to eve::exp2 (T(eve::nbmantissabits (as<eve::element_type_t<T>>())))
|
inlineconstexpr |
Computes the greatest representable value.
Defined in Header
Parameters
Return value
The call eve::valmax(as<T>()) is semantically equivalent to T(std::numeric_limits<element_type_t<T>>::max())
|
inlineconstexpr |
Computes the lowest representable value.
Defined in Header
Parameters
Return value
The call eve::valmin(as<T>()) is semantically equivalent to T(std::numeric_limits<element_type_t<T>>::``lowest())
|
inlineconstexpr |
Computes the constant 0.
Defined in Header
Parameters
Return value
The call eve::zero(as<T>()) is semantically equivalent to T(0).