tts v2.3.0
The Tiny Test System
 
Loading...
Searching...
No Matches

◆ TTS_IEEE_EQUAL

#define TTS_IEEE_EQUAL (   L,
  R,
  ... 
)    TTS_DO_IEEE_EQUAL(L, R, __VA_ARGS__ )

Checks if two values are exactly within a 0 ULP.

This also allow for infinites and NaNs to be compared equal if both values are the same infinites or are both $NaN$. This comparison is performed by using the proper tts::ulp_distance overload.

Parameters
L,RExpressions to compare.
...Optional tag. If equals to REQUIRED, this test will stop the program if it fails.

Example

#define TTS_MAIN
#include <tts/tts.hpp>
TTS_CASE( "ULP distance")
{
float x = std::numeric_limits<float>::quiet_NaN();
TTS_IEEE_EQUAL(1.f, 1.f);
TTS_IEEE_EQUAL(2. , 2. );
TTS_IEEE_EQUAL(65 , 'A');
};
#define TTS_CASE(ID)
Introduces a new test scenario and registers it into the current test driver.
Definition: case.hpp:147
#define TTS_IEEE_EQUAL(L, R,...)
Checks if two values are exactly within a 0 ULP.
Definition: precision.hpp:197