TTS v3.0.0
The Tiny Test System
 
Loading...
Searching...
No Matches
Precision Utilities

Functions

template<typename T , typename U >
double tts::absolute_check (T const &a, U const &b)
 Compute the absolute distance between two values.
 
template<typename T , typename U >
bool tts::ieee_check (T const &a, U const &b)
 Compute if values are exactly equals or all NaNs/Invalids.
 
template<typename T , typename U >
double tts::relative_check (T const &a, U const &b)
 Compute the relative distance between two values.
 
template<typename T , typename U >
double tts::ulp_check (T const &a, U const &b)
 Compute the distance in ULP between two values.
 

Function Documentation

◆ absolute_check()

template<typename T , typename U >
double tts::absolute_check ( T const &  a,
U const &  b 
)
inline

#include <tts/tools/precision.hpp>

Compute the absolute distance between two values.

Note
This functions is meant to help implementing TTS_ABSOLUTE_EQUAL support for custom types. For testing purposes, use TTS_ABSOLUTE_EQUAL directly. See Precision Measurement for more details.
Parameters
aValue to compare
bValue to compare
Returns
The distance between a and b

◆ ieee_check()

template<typename T , typename U >
bool tts::ieee_check ( T const &  a,
U const &  b 
)
inline

#include <tts/tools/precision.hpp>

Compute if values are exactly equals or all NaNs/Invalids.

Note
This functions is meant to help implementing TTS_IEEE_EQUAL support for custom types. For testing purposes, use TTS_IEEE_EQUAL directly. See Precision Measurement for more details.
Parameters
aValue to compare
bValue to compare
Returns
Is a == b or _::is_nan(a) && _::is_nan(b)

◆ relative_check()

template<typename T , typename U >
double tts::relative_check ( T const &  a,
U const &  b 
)
inline

#include <tts/tools/precision.hpp>

Compute the relative distance between two values.

Note
This functions is meant to help implementing TTS_RELATIVE_EQUAL support for custom types. For testing purposes, use TTS_RELATIVE_EQUAL directly. See Precision Measurement for more details.
Parameters
aValue to compare
bValue to compare
Returns
The relative distance between a and b

◆ ulp_check()

template<typename T , typename U >
double tts::ulp_check ( T const &  a,
U const &  b 
)
inline

#include <tts/tools/precision.hpp>

Compute the distance in ULP between two values.

Note
This functions is meant to help implementing TTS_ULP_EQUAL support for custom types. For testing purposes, use TTS_ULP_EQUAL directly. See Precision Measurement for more details.
Parameters
aValue to compare
bValue to compare
Returns
The distance in ULP between a and b