File tree Expand file tree Collapse file tree 5 files changed +17
-14
lines changed
detail/exponential/details Expand file tree Collapse file tree 5 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU)
33
33
target_compile_options (${PROJECT_NAME} -compile-options INTERFACE
34
34
-Wall -Wextra -Wpedantic -Wconversion -Werror=return-type
35
35
)
36
+ # TODO: Remove this later.
37
+ # Some variables have been provided but are not currently being used, but it would not atm make sense to remove them.
38
+ # So to clean up the warnings we are just silencing these specific cases.
39
+ target_compile_options (${PROJECT_NAME} -compile-options INTERFACE
40
+ -Wno-unused-but-set-variable -Wno-unused-value
41
+ )
36
42
endif ()
37
43
38
44
if (CMAKE_CXX_COMPILER_ID STREQUAL MSVC )
Original file line number Diff line number Diff line change @@ -54,17 +54,15 @@ namespace ccm::internal
54
54
ccm::double_t logExpoSum{};
55
55
ccm::double_t polynomialTerm{};
56
56
57
- std::uint64_t intX{};
58
57
std::uint64_t intNorm{};
59
58
std::uint64_t tmp{};
60
59
61
- std::uint32_t top{};
62
60
63
- int expo{};
64
- int i{};
61
+ std:: int64_t expo{};
62
+ std:: int64_t i{};
65
63
66
- intX = ccm::helpers::double_to_uint64 (x);
67
- top = ccm::helpers::top16_bits_of_double (x);
64
+ std:: uint64_t intX = ccm::helpers::double_to_uint64 (x);
65
+ std:: uint32_t top = ccm::helpers::top16_bits_of_double (x);
68
66
69
67
constexpr std::uint64_t low = ccm::helpers::double_to_uint64 (1.0 - 0x1 .5b51p-5 );
70
68
constexpr std::uint64_t high = ccm::helpers::double_to_uint64 (1.0 + 0x1 .6ab2p-5 );
Original file line number Diff line number Diff line change @@ -52,18 +52,16 @@ namespace ccm::internal
52
52
ccm::double_t lowPart{};
53
53
54
54
// Declare variables for bitwise operations
55
- std::uint64_t intX{};
56
55
std::uint64_t intNorm{};
57
56
std::uint64_t tmp{};
58
- std::uint32_t top{};
59
57
60
58
// Declare variables for exponent and loop iteration
61
- int expo{};
62
- int i{};
59
+ std:: int64_t expo{};
60
+ std:: int64_t i{};
63
61
64
62
// Convert input double to uint64_t and extract top 16 bits
65
- intX = ccm::helpers::double_to_uint64 (x);
66
- top = ccm::helpers::top16_bits_of_double (x);
63
+ std:: uint64_t intX = ccm::helpers::double_to_uint64 (x);
64
+ std:: uint32_t top = ccm::helpers::top16_bits_of_double (x);
67
65
68
66
// Constants for comparison
69
67
constexpr std::uint64_t low = ccm::helpers::double_to_uint64 (1.0 - 0x1p-4 );
Original file line number Diff line number Diff line change @@ -74,12 +74,12 @@ namespace ccm::helpers
74
74
*/
75
75
inline constexpr std::uint32_t top16_bits_of_double (double x) noexcept
76
76
{
77
- return bit_cast<std::uint64_t >(x) >> 48 ;
77
+ return static_cast <std:: uint32_t >( bit_cast<std::uint64_t >(x) >> 48 ) ;
78
78
}
79
79
80
80
inline constexpr std::uint32_t top12_bits_of_double (double x) noexcept
81
81
{
82
- return bit_cast<std::uint64_t >(x) >> 52 ;
82
+ return static_cast <std:: uint32_t >( bit_cast<std::uint64_t >(x) >> 52 ) ;
83
83
}
84
84
85
85
inline constexpr std::uint64_t double_to_uint64 (double x) noexcept
Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
#include < gtest/gtest.h>
10
+ #include " ccmath/ccmath.hpp"
10
11
11
12
12
13
int main (int argc, char ** argv)
You can’t perform that action at this time.
0 commit comments