Gromacs
5.1.2
|
#include <testutils/testasserts.h>
Computes and represents a floating-point difference value.
Methods in this class do not throw, except for toString(), which may throw std::bad_alloc.
Public Member Functions | |
FloatingPointDifference (float value1, float value2) | |
Initializes a single-precision difference. | |
FloatingPointDifference (double value1, double value2) | |
Initializes a double-precision difference. | |
bool | isNaN () const |
Whether one or both of the compared values were NaN. More... | |
double | asAbsolute () const |
Returns the difference as an absolute number (always non-negative). | |
gmx_uint64_t | asUlps () const |
Returns the difference as ULPs (always non-negative). More... | |
bool | signsDiffer () const |
Whether the compared values were of different sign. More... | |
bool | isDouble () const |
Whether the difference is between single- or double-precision numbers. | |
std::string | toString () const |
Formats the difference as a string for assertion failure messages. | |