simon-git: spigot (master): Simon Tatham
Commits to Tartarus CVS repository.
tartarus-commits at lists.tartarus.org
Mon Oct 26 19:14:08 GMT 2015
TL;DR:
330feb9 Fix an integer underflow in computing log(0.66).
d9e1e07 Fix assertion failure in continued fractions just under 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-10-26 19:14:08
commit 330feb974e1d0c31c90f02a591c1fb68a88e4d4e
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=330feb974e1d0c31c90f02a591c1fb68a88e4d4e;hp=f131f35f6e1aec590324d8cbc9f196c689d8203a
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Oct 26 18:53:35 2015 +0000
Fix an integer underflow in computing log(0.66).
Values just under 2/3 return -1 from the loop that decides what power
of two to scale them by - but that loop works by bigint_power(), whose
power argument is unsigned.
The easiest fix is just to saturate the exponent at zero - we're
already prepared to tolerate slight overshooting of the range
reduction boundaries (to avoid exactness hazards in the range
reduction step), and it only comes up for values _slightly_ under 2/3.
exp.cpp | 17 +++++++++++++++--
test.sh | 1 +
2 files changed, 16 insertions(+), 2 deletions(-)
commit d9e1e075c2d303131bc6aa0efcc0ac939047906f
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=d9e1e075c2d303131bc6aa0efcc0ac939047906f;hp=330feb974e1d0c31c90f02a591c1fb68a88e4d4e
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Oct 26 19:07:08 2015 +0000
Fix assertion failure in continued fractions just under 1.
In one of the places where we retract a tentatively output continued
fraction term when we find out it was too high, we assert that the
term was more than 1 (and hence, that the value to which we reduced it
was at least 1, i.e. still a sensible continued fraction term at all).
But that's only a requirement for continued fractions _after_ the
initial integer part. Hence, trying to output a continued fraction for
a number close enough below 1 that the tentative output system briefly
thought it _might_ be 1 would fail that assertion.
Fixed by remembering that we're outputting the very first digit.
cfracout.cpp | 15 +++++++++++++--
test.sh | 1 +
2 files changed, 14 insertions(+), 2 deletions(-)
More information about the tartarus-commits
mailing list