Skip to content

Commit

Permalink
Merge branch 'SagnikDey92-bug_fixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
sdavtaker committed Jun 26, 2019
2 parents 7989da7 + 9f7bf45 commit 002a0e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bench/main_bench.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <benchmark/benchmark.h>
#include <real/real.hpp>

unsigned int boost::real::real::maximum_precision = 10;
unsigned int boost::real::real_algorithm::maximum_precision = 10;
std::optional<unsigned int> boost::real::real::maximum_precision = 10;
std::optional<unsigned int> boost::real::real_algorithm::maximum_precision = 10;

BENCHMARK_MAIN();
3 changes: 2 additions & 1 deletion include/real/real_explicit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace boost {
integer_part = integer_part.substr(1);
}
integer_part = regex_replace(integer_part, std::regex("(0?+)([[:digit:]]?+)"), "$2");
int i = decimal_part.length() - 1;
size_t i = decimal_part.length() - 1;
while (decimal_part[i] == '0' && i > 0) {
--i;
}
Expand Down Expand Up @@ -105,6 +105,7 @@ namespace boost {
for (const auto& c : decimal_part ) {
explicit_number.digits.push_back(c - '0');
}
this->_maximum_precision = (int)this->_digits.size();
}

/**
Expand Down

0 comments on commit 002a0e0

Please sign in to comment.