kthohr / gcem

@@ -57,12 +57,11 @@
Loading
57 57
floor_check_internal<float>(const float x)
58 58
noexcept
59 59
{
60 -
    //threshold = 8388608.f;
61 -
62 -
    return (
63 -
        (abs(x) >= 8388608.f) ? \
64 -
        x : \
65 -
        floor_int(x, float(static_cast<int>(x))) );
60 +
    return( abs(x) >= 8388608.f ? \
61 +
            // if
62 +
                x : \
63 +
            // else
64 +
                floor_int(x, float(static_cast<int>(x))) );
66 65
}
67 66
68 67
template<>
@@ -71,12 +70,11 @@
Loading
71 70
floor_check_internal<double>(const double x)
72 71
noexcept
73 72
{
74 -
    //threshold = 4503599627370496.;
75 -
76 -
    return (
77 -
        (abs(x) >= 4503599627370496.) ? \
78 -
        x : \
79 -
        floor_int(x, double(static_cast<llint_t>(x))) );
73 +
    return( abs(x) >= 4503599627370496. ? \
74 +
            // if
75 +
                x : \
76 +
            // else
77 +
                floor_int(x, double(static_cast<llint_t>(x))) );
80 78
}
81 79
82 80
template<>
@@ -85,12 +83,11 @@
Loading
85 83
floor_check_internal<long double>(const long double x)
86 84
noexcept
87 85
{
88 -
    //threshold = 9223372036854775808.l;
89 -
90 -
    return (
91 -
        (abs(x) >= 9223372036854775808.l) ? \
92 -
        x : \
93 -
        floor_int(x, ((long double)static_cast<ullint_t>(abs(x))) * ((x < 0) ? -1.l : 1.l)) );
86 +
    return( abs(x) >= 9223372036854775808.l ? \
87 +
            // if
88 +
                x : \
89 +
            // else
90 +
                floor_int(x, ((long double)static_cast<ullint_t>(abs(x))) * sgn(x)) );
94 91
}
95 92
96 93
template<typename T>

@@ -48,12 +48,11 @@
Loading
48 48
trunc_check_internal<float>(const float x)
49 49
noexcept
50 50
{
51 -
    //threshold = 8388608.f;
52 -
53 -
    return (
54 -
        (abs(x) >= 8388608.f) ? \
55 -
        x : \
56 -
        trunc_int(x) );
51 +
    return( abs(x) >= 8388608.f ? \
52 +
            // if
53 +
                x : \
54 +
            // else
55 +
                trunc_int(x) );
57 56
}
58 57
59 58
template<>
@@ -62,12 +61,11 @@
Loading
62 61
trunc_check_internal<double>(const double x)
63 62
noexcept
64 63
{
65 -
    //threshold = 4503599627370496.;
66 -
67 -
    return (
68 -
        (abs(x) >= 4503599627370496.) ? \
69 -
        x : \
70 -
        trunc_int(x) );
64 +
    return( abs(x) >= 4503599627370496. ? \
65 +
            // if
66 +
                x : \
67 +
            // else
68 +
                trunc_int(x) );
71 69
}
72 70
73 71
template<>
@@ -76,12 +74,11 @@
Loading
76 74
trunc_check_internal<long double>(const long double x)
77 75
noexcept
78 76
{
79 -
    //threshold = 9223372036854775808.l;
80 -
81 -
    return (
82 -
        (abs(x) >= 9223372036854775808.l) ? \
83 -
        x : \
84 -
        ((long double)static_cast<ullint_t>(abs(x))) * ((x < 0) ? -1.l : 1.l) );
77 +
    return( abs(x) >= 9223372036854775808.l ? \
78 +
            // if
79 +
                x : \
80 +
            // else
81 +
                ((long double)static_cast<ullint_t>(abs(x))) * sgn(x) );
85 82
}
86 83
87 84
template<typename T>

@@ -39,6 +39,7 @@
Loading
39 39
    GCEM_TEST_COMPARE_VALS(gcem::floor,std::floor, -4.7);
40 40
    GCEM_TEST_COMPARE_VALS(gcem::floor,std::floor, -5.0);
41 41
    GCEM_TEST_COMPARE_VALS(gcem::floor,std::floor, 42e32);
42 +
    GCEM_TEST_COMPARE_VALS(gcem::floor,std::floor, -42e32);
42 43
43 44
    GCEM_TEST_COMPARE_VALS(gcem::floor,std::floor,  std::numeric_limits<float>::max());
44 45
    GCEM_TEST_COMPARE_VALS(gcem::floor,std::floor, -std::numeric_limits<long double>::infinity());
@@ -57,6 +58,7 @@
Loading
57 58
    GCEM_TEST_COMPARE_VALS(gcem::ceil,std::ceil, -4.7);
58 59
    GCEM_TEST_COMPARE_VALS(gcem::ceil,std::ceil, -5.0);
59 60
    GCEM_TEST_COMPARE_VALS(gcem::ceil,std::ceil, 42e32);
61 +
    GCEM_TEST_COMPARE_VALS(gcem::ceil,std::ceil, -42e32);
60 62
61 63
    GCEM_TEST_COMPARE_VALS(gcem::ceil,std::ceil,  std::numeric_limits<float>::max());
62 64
    GCEM_TEST_COMPARE_VALS(gcem::ceil,std::ceil, -std::numeric_limits<long double>::infinity());
@@ -75,6 +77,7 @@
Loading
75 77
    GCEM_TEST_COMPARE_VALS(gcem::trunc,std::trunc, -4.7);
76 78
    GCEM_TEST_COMPARE_VALS(gcem::trunc,std::trunc, -5.0);
77 79
    GCEM_TEST_COMPARE_VALS(gcem::trunc,std::trunc, 42e32);
80 +
    GCEM_TEST_COMPARE_VALS(gcem::trunc,std::trunc, -42e32);
78 81
79 82
    GCEM_TEST_COMPARE_VALS(gcem::trunc,std::trunc,  std::numeric_limits<float>::max());
80 83
    GCEM_TEST_COMPARE_VALS(gcem::trunc,std::trunc, -std::numeric_limits<long double>::infinity());
@@ -94,6 +97,7 @@
Loading
94 97
    GCEM_TEST_COMPARE_VALS(gcem::round,std::round, -4.7);
95 98
    GCEM_TEST_COMPARE_VALS(gcem::round,std::round, -5.0);
96 99
    GCEM_TEST_COMPARE_VALS(gcem::round,std::round, 42e32);
100 +
    GCEM_TEST_COMPARE_VALS(gcem::round,std::round, -42e32);
97 101
98 102
    GCEM_TEST_COMPARE_VALS(gcem::round,std::round,  std::numeric_limits<float>::max());
99 103
    GCEM_TEST_COMPARE_VALS(gcem::round,std::round, -std::numeric_limits<long double>::infinity());
Files Coverage
include/gcem_incl 78.13%
tests 95.77%
Project Totals (69 files) 85.18%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading