Holds the limits and special values of a type T.
More...
template<typename T>
struct tts::limits_set< T >
Holds the limits and special values of a type T.
Each member is a value of T and an edge case for the test data. A specialization for a user-defined type can provide limits of its own.
#define TTS_MAIN
#include <tts/tts.hpp>
{
TTS_EQUAL(l.inf, std::numeric_limits<float>::infinity());
TTS_EQUAL(l.valmax, std::numeric_limits<float>::max());
TTS_EQUAL(l.valmin, std::numeric_limits<float>::lowest());
TTS_EQUAL(l.maxflint,
static_cast<float>(1u << std::numeric_limits<float>::digits));
};
- Template Parameters
-
| T | Type whose limits are held |
|
|
T | inf |
| | \(+\infty\), for floating-point base types.
|
|
T | maxflint |
| | Largest \(M\) with every integer of \([-M, M]\) exact, for floating-point base types.
|
|
T | mindenormal |
| | Smallest positive subnormal value, for floating-point base types.
|
|
T | minf |
| | \(-\infty\), for floating-point base types.
|
|
T | mone |
| | \(-1\), for floating-point base types.
|
|
T | mzero |
| | \(-0\), for floating-point base types.
|
|
T | nan |
| | Quiet NaN, for floating-point base types.
|
|
T | one |
| | \(1\).
|
|
T | smallestposval |
| | Smallest positive normal value, for floating-point base types.
|
|
T | valmax |
| | Largest representable value of the base type.
|
|
T | valmin |
| | Lowest representable value of the base type, its most negative one.
|
|
T | zero |
| | \(0\).
|
|
(Note that these are not member symbols.)
|
| template<typename T> |
| auto | limits (tts::type< T >) |
| | Returns the limits and special values of a type T.
|