simon-git: spigot (master): Simon Tatham

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Sun Apr 19 08:33:04 BST 2015


TL;DR:
  b5bdcad Fix the exactness hazard in pow(non-obvious zero, positive).
  52102fc Missing error check in the parser.

Repository:     git://git.tartarus.org/simon/spigot.git
On the web:     http://tartarus.org/~simon-git/gitweb/?p=spigot.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2015-04-19 08:33:04

commit b5bdcadc93e0e3af631116a513e5be9423cb30bc
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=b5bdcadc93e0e3af631116a513e5be9423cb30bc;hp=a3143c6e83def87e818f55d328ecb8d67b9fd7d8
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Apr 19 07:10:20 2015 +0100

    Fix the exactness hazard in pow(non-obvious zero, positive).
    
    Using exactly the strategy I outlined in TODO yesterday: we carefully
    detect that case without doing a straight sign test of a, then hand
    off to a PowPrefixWrapper class which narrows an output interval about
    zero for as long as a remains indistinguishable from zero, and then
    switches to doing things the normal way if the sign of a turns up
    later.
    
    That was the last known internal exactness hazard! Hence, I've had to
    completely rewrite the docs section about them, since I now can't
    exhibit the existence of any, and have no need to list the known ones
    as areas for user caution. Instead, the new section gives a historical
    example, and explains how to identify things like it as a bug and
    report them.

 TODO.txt   |   31 -----
 exp.cpp    |  420 ++++++++++++++++++++++++++++++++++++++++++++++++------------
 manual.but |  154 ++++++++++++++--------
 test.sh    |    2 +
 4 files changed, 441 insertions(+), 166 deletions(-)

commit 52102fc59026cc90e53bd60a196496d06778aff3
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=52102fc59026cc90e53bd60a196496d06778aff3;hp=b5bdcadc93e0e3af631116a513e5be9423cb30bc
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Apr 19 08:08:13 2015 +0100

    Missing error check in the parser.
    
    I had checked all cases in which we expected a token and didn't see
    it, but not the one case where we _didn't_ expect a token and _did_
    see one, i.e. spurious junk at the end of the string!
    
    This bit me while trying to test the pow exactness hazard fix, because
    I tried to evaluate 'pow(sin(pi), pi)) + sqrt(2)' (which has one too
    many closing parens before the plus sign) and found that spigot had
    silently interpreted it as 'pow(sin(pi), pi)', ignoring everything
    thereafter because the spurious close paren terminated the outermost
    parse_recursive().

 expr.cpp |    3 +++
 1 file changed, 3 insertions(+)



More information about the tartarus-commits mailing list