Skip to content

Commit

Permalink
compilation fix for gcc and clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravenwater committed Aug 22, 2023
1 parent b29c975 commit f42644c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/universal/number/dbns/dbns_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ class dbns {
assert(best_b >= 0); // second exponent is negative
int a = static_cast<unsigned>(-best_a);
int b = static_cast<unsigned>(best_b);
if (a < 0 || a > MAX_A || b > MAX_B) {
if (a < 0 || a > static_cast<int>(MAX_A) || b > static_cast<int>(MAX_B)) {
// try to project the value back into valid pairs
// the approximations of unity looks like (8,-5), (19,-12), (84,-53),...
// they grow too fast and in a rather irregular manner. There are more
Expand Down
6 changes: 3 additions & 3 deletions static/dbns/conversion/rounding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ namespace sw { namespace universal {
using std::round;

DbnsType doubleBaseNumber{ 0 };
typedef DbnsType::BlockType BlockType;
constexpr unsigned nbits = DbnsType::nbits;
typedef typename DbnsType::BlockType BlockType;
//constexpr unsigned nbits = DbnsType::nbits;
constexpr unsigned fbbits = DbnsType::fbbits;
constexpr unsigned sbbits = DbnsType::sbbits;
constexpr uint64_t FB_MASK = DbnsType::FB_MASK;
Expand Down Expand Up @@ -160,7 +160,7 @@ namespace sw { namespace universal {
assert(best_b >= 0); // second exponent is negative
int a = static_cast<unsigned>(-best_a);
int b = static_cast<unsigned>(best_b);
if (a < 0 || a > MAX_A || b > MAX_B) {
if (a < 0 || a > static_cast<int>(MAX_A) || b > static_cast<int>(MAX_B)) {
// try to project the value back into valid pairs
// the approximations of unity looks like (8,-5), (19,-12), (84,-53),...
// they grow too fast and in a rather irregular manner. There are more
Expand Down

0 comments on commit f42644c

Please sign in to comment.