simon-git: spigot (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Thu Aug 31 08:33:50 BST 2017
TL;DR:
de30d90 Expose Spigot::is_rational() in the Python API.
5c2225e Fix an obvious goof in mkintspig.
726a32b Python code: fix some careless uses of None.
652f64b powbegin: permit a non-integer value of a.
8d56ccc powbegin: support a constant multiplicative factor.
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: 2017-08-31 08:33:50
commit de30d907bc146efb0a6ce5d58e187ab167870459
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=de30d907bc146efb0a6ce5d58e187ab167870459;hp=32b73a48e30882f0e5a0cfae6ac932c9593b2571
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Aug 31 07:18:06 2017 +0100
Expose Spigot::is_rational() in the Python API.
In Python, of course, we don't have to faff about with a boolean
return value and writable reference parameters; the return value is
simply an (n,d) tuple or None.
python/pyspig.cpp | 19 +++++++++++++++++++
python/spig/__init__.py | 3 +++
2 files changed, 22 insertions(+)
commit 5c2225e6ade8988abf05fa776e1b103038e3efe8
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=5c2225e6ade8988abf05fa776e1b103038e3efe8;hp=de30d907bc146efb0a6ce5d58e187ab167870459
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Aug 31 08:23:14 2017 +0100
Fix an obvious goof in mkintspig.
You can't pass an outer Python spigot object to the inner
C++ clone method.
python/spig/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 726a32b7a2090a6086fcb3f02e3f4bafd1a00199
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=726a32b7a2090a6086fcb3f02e3f4bafd1a00199;hp=5c2225e6ade8988abf05fa776e1b103038e3efe8
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Aug 31 08:24:36 2017 +0100
Python code: fix some careless uses of None.
Testing against None should be done with 'is', not '=='. Also, the
check of scope against None in Spigot.__init__ was totally spurious.
python/powbegin.py | 6 +++---
python/spig/__init__.py | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
commit 652f64bdb1c509caa6f540575e143841b95ff2af
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=652f64bdb1c509caa6f540575e143841b95ff2af;hp=726a32b7a2090a6086fcb3f02e3f4bafd1a00199
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Aug 31 08:26:23 2017 +0100
powbegin: permit a non-integer value of a.
Now you can ask, for example, whether there's a power of pi or e or
phi that begins with particular digits.
python/powbegin.py | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
commit 8d56cccabfd246f8ec534a0400b263db371fae00
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=8d56cccabfd246f8ec534a0400b263db371fae00;hp=652f64bdb1c509caa6f540575e143841b95ff2af
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Aug 31 08:27:05 2017 +0100
powbegin: support a constant multiplicative factor.
Now you can ask for an integer n such that a^n * f begins with given
digits. For example, you can set a=phi and f=1/sqrt(5), which will
tell you whether phi^n/sqrt(5) begins with given digits. (Which, up to
small errors at interval ends due to the (-1/phi)^n term in Binet's
formula, is _nearly_ always the same as saying that the nth Fibonacci
number begins with those digits.)
For example, the command
powbegin.py -M '1/sqrt(5)' phi 1234
delivers the result 1629, which strongly suggests (but doesn't _quite_
prove by itself) that F_1629 starts with the digits 1234, and indeed
if you evaluate it by hand, it does indeed.
python/powbegin.py | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
More information about the tartarus-commits
mailing list