Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Classes | Concepts | Functions
uni20::check Namespace Reference

Classes

struct  FloatingULP
 Compare floating point or complex values within a given ULP tolerance. More...
 
struct  FloatingULP< T >
 ULP comparator for complex numbers over floating point. More...
 

Concepts

concept  IeeeBinaryReal
 Real scalar stored in an IEEE binary32, binary64, or binary128 interchange representation.
 
concept  UlpOrderedReal
 Real scalar with an implemented ordering of adjacent representable values.
 
concept  UlpComparable
 Concept satisfied if T can be compared in ULPs.
 

Functions

template<UlpOrderedReal T>
long long float_abs_distance (T a, T b)
 Return the absolute diagnostic ULP distance between two real scalars.
 
template<uni20::Complex T>
requires UlpOrderedReal<uni20::make_real_t<T>>
long long float_abs_distance (T a, T b)
 
template<UlpOrderedReal T>
long long float_distance (T a, T b)
 Return the signed distance in ULPs between two supported real scalars.
 

Function Documentation

◆ float_abs_distance() [1/2]

template<UlpOrderedReal T>
long long uni20::check::float_abs_distance ( T  a,
T  b 
)
inline

Return the absolute diagnostic ULP distance between two real scalars.

◆ float_abs_distance() [2/2]

template<uni20::Complex T>
requires UlpOrderedReal<uni20::make_real_t<T>>
long long uni20::check::float_abs_distance ( T  a,
T  b 
)
inline

◆ float_distance()

template<UlpOrderedReal T>
long long uni20::check::float_distance ( T  a,
T  b 
)
inline

Return the signed distance in ULPs between two supported real scalars.

  • Positive if b > a, negative if a > b.
  • Returns 0 if a == b (including +0 vs -0).
  • Returns max<long long> if either value is NaN or if infinities differ.
  • Saturates when the finite distance exceeds the signed diagnostic range.
    Template Parameters
    TIEEE binary interchange or native extended long double scalar type.