Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
|
#include <cassert>
#include <cinttypes>
#include <cstring>
#include <cmath>
#include <jau/test/catch2_ext.hpp>
#include <jau/float_math.hpp>
#include <jau/basic_types.hpp>
Go to the source code of this file.
Functions | |
static void | test05CompareWithEpsilon (int i, const float epsilon) |
TEST_CASE ("Float Compare Fixed Epsilon Test 20", "[math][datatype][float][epsilon]") | |
TEST_CASE ("Float Compare Mac Epsilon Test 21", "[math][datatype][float][epsilon]") | |
TEST_CASE ("Float Compare Zero Epsilon Test 10", "[math][datatype][float][epsilon]") | |
TEST_CASE ("Float Epsilon Test 01", "[math][datatype][float][epsilon]") | |
TEST_CASE ("Float Equals Fixed Epsilon Test 20", "[math][datatype][float][epsilon]") | |
TEST_CASE ("Float Equals Mach Epsilon Test 21", "[math][datatype][float][epsilon]") | |
TEST_CASE ("Float Equals No Epsilon Test 22", "[math][datatype][float][epsilon]") | |
TEST_CASE ("Float IEEE 754 (IEC 559) Test 00", "[math][datatype][float][iec559]") | |
TEST_CASE ("Float Zero Fixed Epsilon Test 10", "[math][datatype][float][epsilon]") | |
TEST_CASE ("Float Zero Mach Epsilon Test 11", "[math][datatype][float][epsilon]") | |
TEST_CASE ("Float Zero No Epsilon Test 12", "[math][datatype][float][epsilon]") | |
static void | testCompareNoEpsilon (const int tstNum, const int exp, const float a, const float b) |
static void | testCompareWithEpsilon (const int tstNum, const int exp, const float a, const float b, const float epsilon) |
static void | testEqualsNoEpsilon (const int tstNum, const bool exp, const float a, const float b) |
static void | testEqualsWithEpsilon (const int tstNum, const bool exp, const float a, const float b, const float epsilon=std::numeric_limits< float >::epsilon()) |
static void | testEqualsWithEpsilon (int i, const float epsilon=std::numeric_limits< float >::epsilon()) |
template<class T , std::enable_if_t<!std::numeric_limits< T >::is_integer, bool > = true> | |
void | testFloatBits (const T a) |
template<class T , std::enable_if_t<!std::numeric_limits< T >::is_integer, bool > = true> | |
void | testFloatBits (const T a, const typename jau::uint_bytes< sizeof(T)>::type exp_a_bits) |
void | testIEC559DoubleType () |
void | testIEC559FloatType () |
static void | testZeroNoEpsilon (const int tstNum, const bool exp, const float a) |
static void | testZeroWithEpsilon1 (const int tstNum, const bool exp, const float a, const float epsilon=std::numeric_limits< float >::epsilon()) |
static void | testZeroWithEpsilon1 (int i, const float epsilon=std::numeric_limits< float >::epsilon()) |
Variables | |
static const float | MACH_EPSILON = jau::machineEpsilon<float>() |
static const double | MACH_EPSILON_DOUBLE = jau::machineEpsilon<double>() |
static const float | MAX_VALUE = std::numeric_limits<float>::max() |
static const float | MIN_VALUE = std::numeric_limits<float>::min() |
static const float | NaN = std::numeric_limits<float>::quiet_NaN() |
static const double | NaN_DBL = std::numeric_limits<double>::quiet_NaN() |
static const float | NEGATIVE_INFINITY = -std::numeric_limits<float>::infinity() |
static const double | NEGATIVE_INFINITY_DBL = -std::numeric_limits<double>::infinity() |
static const float | POSITIVE_INFINITY = std::numeric_limits<float>::infinity() |
static const double | POSITIVE_INFINITY_DBL = std::numeric_limits<double>::infinity() |
void testIEC559FloatType | ( | ) |
void testIEC559DoubleType | ( | ) |
void testFloatBits | ( | const T | a | ) |
void testFloatBits | ( | const T | a, |
const typename jau::uint_bytes< sizeof(T)>::type | exp_a_bits | ||
) |
Definition at line 86 of file test_math_float.cpp.
TEST_CASE | ( | "Float IEEE 754 (IEC 559) Test 00" | , |
"" | [math][datatype][float][iec559] | ||
) |
Definition at line 93 of file test_math_float.cpp.
TEST_CASE | ( | "Float Epsilon Test 01" | , |
"" | [math][datatype][float][epsilon] | ||
) |
Definition at line 126 of file test_math_float.cpp.
|
static |
|
static |
Definition at line 159 of file test_math_float.cpp.
TEST_CASE | ( | "Float Zero Fixed Epsilon Test 10" | , |
"" | [math][datatype][float][epsilon] | ||
) |
Definition at line 171 of file test_math_float.cpp.
TEST_CASE | ( | "Float Zero Mach Epsilon Test 11" | , |
"" | [math][datatype][float][epsilon] | ||
) |
Definition at line 174 of file test_math_float.cpp.
|
static |
TEST_CASE | ( | "Float Zero No Epsilon Test 12" | , |
"" | [math][datatype][float][epsilon] | ||
) |
Definition at line 185 of file test_math_float.cpp.
|
static |
|
static |
Definition at line 212 of file test_math_float.cpp.
TEST_CASE | ( | "Float Equals Fixed Epsilon Test 20" | , |
"" | [math][datatype][float][epsilon] | ||
) |
Definition at line 230 of file test_math_float.cpp.
TEST_CASE | ( | "Float Equals Mach Epsilon Test 21" | , |
"" | [math][datatype][float][epsilon] | ||
) |
Definition at line 234 of file test_math_float.cpp.
|
static |
TEST_CASE | ( | "Float Equals No Epsilon Test 22" | , |
"" | [math][datatype][float][epsilon] | ||
) |
Definition at line 249 of file test_math_float.cpp.
|
static |
TEST_CASE | ( | "Float Compare Zero Epsilon Test 10" | , |
"" | [math][datatype][float][epsilon] | ||
) |
Definition at line 280 of file test_math_float.cpp.
|
static |
|
static |
TEST_CASE | ( | "Float Compare Fixed Epsilon Test 20" | , |
"" | [math][datatype][float][epsilon] | ||
) |
Definition at line 354 of file test_math_float.cpp.
TEST_CASE | ( | "Float Compare Mac Epsilon Test 21" | , |
"" | [math][datatype][float][epsilon] | ||
) |
Definition at line 358 of file test_math_float.cpp.
|
static |
Definition at line 36 of file test_math_float.cpp.
|
static |
Definition at line 37 of file test_math_float.cpp.
|
static |
Definition at line 39 of file test_math_float.cpp.
|
static |
Definition at line 40 of file test_math_float.cpp.
|
static |
Definition at line 41 of file test_math_float.cpp.
|
static |
Definition at line 42 of file test_math_float.cpp.
|
static |
Definition at line 43 of file test_math_float.cpp.
|
static |
Definition at line 47 of file test_math_float.cpp.
|
static |
Definition at line 48 of file test_math_float.cpp.
|
static |
Definition at line 49 of file test_math_float.cpp.