simon-git: spigot (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Feb 1 18:47:34 GMT 2018


TL;DR:
  924e036 Fix an assertion failure in compute_exponent.

Repository:     https://git.tartarus.org/simon/spigot.git
On the web:     https://git.tartarus.org/?p=simon/spigot.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2018-02-01 18:47:34

commit 924e0361f3c77d98b4af4ba0f7bcd7c8693b79b9
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=924e0361f3c77d98b4af4ba0f7bcd7c8693b79b9;hp=13af0357916d927f57a74998de51e93ddadc96a4
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Feb 1 18:12:32 2018 +0000

    Fix an assertion failure in compute_exponent.
    
    This function, introduced in commit bcadf64be, includes a special-case
    handler for the situation in which the exponent base is 2, there's
    only one output digit to be generated, and directed rounding is in
    use.
    
    Since the middle one of those three conditions (that there's only one
    output digit to be generated) is dependent on the choice of exponent,
    we can only find it out by actually setting an experimental throwaway
    formatter to use that exponent, and then querying it to see if it
    reports having a digit limit. But that can cause problems if the
    formatter also specifies a minimum exponent and our test exponent was
    less than it! IEEEFormatter in particular does enforce by assertion
    that the exponent it's given is not less than its min exp, so this
    caused an assertion failure in the IEEE-output test case added in this
    commit.
    
    Annoyingly, I'm not actually sure any more what that special-case
    handler is _for_. Removing it completely doesn't cause anything in the
    current spigot test suite to fail, and that's still true even if I
    back up all the way to the commit that introduced it. I wish I'd
    commented it more usefully now. I'm sorely tempted to remove it
    completely and wait to find out what might go wrong as a result.
    
    However, for the moment, I'll leave the special case active in most
    cases, and only turn it off in the case where the formatter's min exp
    prevents it from being used. That fixes the immediate problem, and if
    I later stumble across any further failures, I can always use them to
    get a better understanding of what I might have been thinking back in
    2015 :-(

 baseout.cpp | 6 ++++--
 test.sh     | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)



More information about the tartarus-commits mailing list