• Tor Didriksen's avatar
    Bug#11754279 SIGNIFICANT INACCURACY IN DECIMAL MULTIPLICATION CALCULATIONS · 6cbbe239
    Tor Didriksen authored
        frac is the number of decimal digits after the point
    For each multiplication in the expression, decimal_mul() does this:
      to->frac= from1->frac + from2->frac;              /* store size in digits */
    which will eventually overflow.
    The code for handling the overflow, will truncate the two digits in "1.75" to "1"
    
    Solution:
    Truncate to 31 significant fractional digits, when doing decimal multiplication.
    6cbbe239
decimal.c 86.3 KB