1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Mildly simplified syntax.

This commit is contained in:
Thomas Harte 2017-07-21 18:18:45 -04:00
parent 70af075012
commit 9e975a46a2

View File

@ -9,15 +9,15 @@
#ifndef Factors_hpp
#define Factors_hpp
#include <utility>
namespace NumberTheory {
/*!
@returns The greatest common divisor of @c a and @c b as computed by Euclid's algorithm.
*/
template<class T> T greatest_common_divisor(T a, T b) {
if(a < b) {
T swap = b;
b = a;
a = swap;
std::swap(a, b);
}
while(1) {