simon-git: spigot (master): Simon Tatham

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Wed Dec 17 12:37:59 GMT 2014


TL;DR:
  77c4c8d Reimplement exp2 and exp10 in terms of pow.
  9c4d00d Make the 'rem' operator have proper IEEE 754 tie-breaking.
  7534b59 Refactor the code for matching colon-prefix keywords.
  0d4c40b Change 'baseNfile:' and 'cfracfile:' to be inexact.
  82e8814 Add a TODO.txt to store future development thoughts.

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:           2014-12-17 12:37:59

commit 77c4c8d452588096361239fbd171fe5cb863b24d
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=77c4c8d452588096361239fbd171fe5cb863b24d;hp=f074b8564cc2ac89444e77fa2431be2cb808f034
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Dec 17 09:13:46 2014 +0000

    Reimplement exp2 and exp10 in terms of pow.
    
    Now that pow supports the integer special case, it seems silly for
    these functions not to - why _wouldn't_ you want exp2(3) or exp10(-2)
    to work?

 exp.cpp |    6 ++----
 test.sh |    2 ++
 2 files changed, 4 insertions(+), 4 deletions(-)

commit 9c4d00d8acc8f1fc2df05f2a45356084afb292e2
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=9c4d00d8acc8f1fc2df05f2a45356084afb292e2;hp=77c4c8d452588096361239fbd171fe5cb863b24d
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Dec 17 09:53:10 2014 +0000

    Make the 'rem' operator have proper IEEE 754 tie-breaking.
    
    It was always intended to, but I think I must have not revisited it
    since I implemented enough rational-handling to actually detect ties
    in the first place.

 bi_gmp.h   |    8 ++++++-
 manual.but |   13 ++++++------
 test.sh    |    8 +++++++
 unary.cpp  |   69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 4 files changed, 86 insertions(+), 12 deletions(-)

commit 7534b5923ee04994e222c6131df2bdc599075ab8
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=7534b5923ee04994e222c6131df2bdc599075ab8;hp=9c4d00d8acc8f1fc2df05f2a45356084afb292e2
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Dec 17 11:05:38 2014 +0000

    Refactor the code for matching colon-prefix keywords.
    
    I spotted a case of 'if (p-q == X && !strncmp(q, "something", X))'
    with the wrong value of X (not matching the length of the string),
    which clearly should be fixed by removing the need to do that error-
    prone length counting at all. Hence, I now extract any such keyword
    into a separate string, where it can be parsed conveniently with safer
    tools such as sscanf or straight strcmp.
    
    Also added a couple of basic tests of file-reading (rather than
    fd-reading), so that now all keyword types are getting at least one
    test. If I'd done that before, I'd probably have spotted this error
    sooner. Ahem.

 expr.cpp |   69 +++++++++++++++++++++++++++++++++++++++++++++++---------------
 test.sh  |    4 ++++
 2 files changed, 57 insertions(+), 16 deletions(-)

commit 0d4c40b76218b3a17890de754c9025ebc088db3e
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=0d4c40b76218b3a17890de754c9025ebc088db3e;hp=7534b5923ee04994e222c6131df2bdc599075ab8
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Dec 17 11:58:24 2014 +0000

    Change 'baseNfile:' and 'cfracfile:' to be inexact.
    
    We now assume that the data we read from files in response to those
    options are not representations of exact rationals, but rather
    truncated prefixes of a longer expansion. So we generate as many
    digits of the output as the precision of that expansion permits (or
    fewer, if we reach the specified digit limit first), but then print an
    error rather than generate any output based on assuming what the next
    digit might have been.
    
    New keywords with 'xfile' in place of 'file' are supported, to provide
    the previous behaviour for anyone who really wanted it.

 error.h    |   46 +++++++++++++++++++++++++---------
 expr.cpp   |   10 ++++++--
 funcs.h    |    4 +--
 io.cpp     |   82 +++++++++++++++++++++++++++++++++++++++++++++++-------------
 main.cpp   |   23 +++++++++++++++++
 manual.but |   76 +++++++++++++++++++++++++++++++++++++++++++++++--------
 test.sh    |   18 ++++++++++---
 7 files changed, 212 insertions(+), 47 deletions(-)

commit 82e8814b97b445f62e073988c7c01648dc80d585
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=82e8814b97b445f62e073988c7c01648dc80d585;hp=0d4c40b76218b3a17890de754c9025ebc088db3e
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Dec 17 12:24:54 2014 +0000

    Add a TODO.txt to store future development thoughts.
    
    It's about time I started keeping these somewhere they won't get lost,
    instead of un-checked-in jotting files in my working directory.

 TODO.txt |  149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 149 insertions(+)



More information about the tartarus-commits mailing list