simon-git: spigot (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Feb 9 19:03:53 GMT 2017


TL;DR:
  795f2e6 Fix failure to normalise mpz_cmp return values.
  7801f69 Use spigot_square() to optimise spigot_hypot().

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-02-09 19:03:53

commit 795f2e6b5c66bd7f3f777ab5c6ab227df314bfd3
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=795f2e6b5c66bd7f3f777ab5c6ab227df314bfd3;hp=e5395f8bce48fd71cf4702bfdcf0bf33c37b5b6b
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Feb 9 18:54:41 2017 +0000

    Fix failure to normalise mpz_cmp return values.
    
    The mpz_cmp_* functions work like strcmp: they return a result of the
    right sign, but it's not guaranteed to always be the _same_ result for
    a given sign. Hence, comparing two return values against _each other_
    is the wrong way to see if two comparisons went the same way -
    instead, you must first normalise non-zero results to some canonical
    values like +1 and -1.
    
    algebraic.cpp does compare two return values from bigint_sign(), so
    let's ensure that bigint_sign() does the normalisation to make that
    legal.

 bi_gmp.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

commit 7801f69298cde7e1ee53ac65c1058dd08efcd1d6
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=7801f69298cde7e1ee53ac65c1058dd08efcd1d6;hp=795f2e6b5c66bd7f3f777ab5c6ab227df314bfd3
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Feb 9 18:59:27 2017 +0000

    Use spigot_square() to optimise spigot_hypot().
    
    Another opportunity I've only just noticed for avoiding the need to
    clone and double-evaluate our input spigots.

 sqrt.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)



More information about the tartarus-commits mailing list