mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-24 12:30:17 +00:00
Mildly simplified syntax.
This commit is contained in:
parent
70af075012
commit
9e975a46a2
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user