simon-git: spigot (master): Simon Tatham

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Thu Apr 30 18:41:23 BST 2015


TL;DR:
  a6e7c65 Implement ceil as -floor(-x), not as floor(x)+1.

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-30 18:41:23

commit a6e7c6536138d5e8cdae0e089fc74329b92373ae
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=a6e7c6536138d5e8cdae0e089fc74329b92373ae;hp=5d3f54ed962705855ee78b2c5ee763eabc19e1d5
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Apr 30 18:34:46 2015 +0100

    Implement ceil as -floor(-x), not as floor(x)+1.
    
    The previous implementation had a special case for known integers, of
    course (otherwise it would have been _obviously_ incorrect). But it
    falls over in the case of a number that _turns out_ to be an integer.
    In particular, ceil(1+sqrt(0)) returned 2, ahem.

 test.sh   |    3 +++
 unary.cpp |   13 ++++---------
 2 files changed, 7 insertions(+), 9 deletions(-)



More information about the tartarus-commits mailing list