simon-git: spigot (master): spigot.git

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sat Nov 12 18:48:39 GMT 2016


TL;DR:
  c4fb15e Fix an assertion failure in BaseOutputGenerator.

Repository:     https://git.tartarus.org/simon/spigot.git
On the web:     https://git.tartarus.org/?p=simon/spigot.git
Branch updated: master
Committer:      spigot.git
Date:           2016-11-12 18:48:39

commit c4fb15e6b7d8c31f213f2de40a22ce215c9bb0bd
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=c4fb15e6b7d8c31f213f2de40a22ce215c9bb0bd;hp=8910d67916655ff4334ac128fc958bb4f1ca864e
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Nov 12 18:37:13 2016 +0000

    Fix an assertion failure in BaseOutputGenerator.
    
    Printing the value of W(1.7) = 0.779... with round-to-nearest enabled
    caused an assertion failure, because BaseOutputGenerator created
    formatters for two exponent values (one for the first nonzero digit
    being just after the decimal point, and one for it being just before),
    and accidentally still had a formatter for the higher exponent on the
    go by the time the lower exponent was considering initial digits of 7
    and 8 (implying that rounding up to 1.anything was not going to
    happen).
    
    I already had a special case for handling this situation (where you
    have two formatters for the lower exponent and the higher one tries to
    add a third because its rounding granularity is much greater), but
    apparently I had specified too conservatively the circumstances in
    which that handling should apply. Removing one of the five clauses in
    the if statement makes this case start working again, and doesn't seem
    to have broken anything else (thank goodness for regression test
    suites).
    
    This happened to me for W(1.7) but not for any other way of
    generating a number in the same range, so I have to suppose it was
    sensitive to some particular detail of the rate at which the output of
    MonotoneInverter narrowed its range.

 baseout.cpp | 1 -
 test.sh     | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)



More information about the tartarus-commits mailing list