Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81810 - trunk/boost/multiprecision/detail
From: john_at_[hidden]
Date: 2012-12-09 11:41:54


Author: johnmaddock
Date: 2012-12-09 11:41:53 EST (Sun, 09 Dec 2012)
New Revision: 81810
URL: http://svn.boost.org/trac/boost/changeset/81810

Log:
Tweak GCD for better performance.
Text files modified:
   trunk/boost/multiprecision/detail/integer_ops.hpp | 8 ++++----
   1 files changed, 4 insertions(+), 4 deletions(-)

Modified: trunk/boost/multiprecision/detail/integer_ops.hpp
==============================================================================
--- trunk/boost/multiprecision/detail/integer_ops.hpp (original)
+++ trunk/boost/multiprecision/detail/integer_ops.hpp 2012-12-09 11:41:53 EST (Sun, 09 Dec 2012)
@@ -86,12 +86,12 @@
    {
       /* Now u and v are both odd, so diff(u, v) is even.
       Let u = min(u, v), v = diff(u, v)/2. */
- if(u.compare(v) > 0)
+ s = u.compare(v);
+ if(s > 0)
          u.swap(v);
- eval_subtract(v, u);
- // Termination condition tries not to do a full compare if possible:
- if(eval_is_zero(v))
+ if(s == 0)
          break;
+ eval_subtract(v, u);
       vs = eval_lsb(v);
       eval_right_shift(v, vs);
    }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk