Skip to content

Commit

Permalink
Fix test-gnc-euro failure.
Browse files Browse the repository at this point in the history
Fixing the pow[] array required also adjusting the number of
denominator digits when converting doubles to gnc_numerics.
  • Loading branch information
jralls committed May 20, 2023
1 parent b3bf11c commit bba49a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libgnucash/engine/gnc-numeric.cpp
Expand Up @@ -79,7 +79,7 @@ GncNumeric::GncNumeric(GncRational rr)

GncNumeric::GncNumeric(double d) : m_num(0), m_den(1)
{
static uint64_t max_leg_value{INT64_C(1000000000000000000)};
static uint64_t max_leg_value{INT64_C(100000000000000000)};
if (std::isnan(d) || fabs(d) > max_leg_value)
{
std::ostringstream msg;
Expand All @@ -91,7 +91,7 @@ GncNumeric::GncNumeric(double d) : m_num(0), m_den(1)
int64_t den;
uint8_t den_digits;
if (logval > 0.0)
den_digits = (max_leg_digits + 1) - static_cast<int>(floor(logval) + 1.0);
den_digits = (max_leg_digits + 1) - static_cast<int>(floor(logval));
else
den_digits = max_leg_digits;
den = powten(den_digits);
Expand Down

0 comments on commit bba49a6

Please sign in to comment.