aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/algorithm.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/algorithm.h b/common/algorithm.h
index 9d22af4090..67ffe122f9 100644
--- a/common/algorithm.h
+++ b/common/algorithm.h
@@ -242,8 +242,8 @@ void sort(T first, T last) {
*/
template<class T>
T gcd(T a, T b) {
- if (a <= 0) a = -a;
- if (b <= 0) b = -b;
+ if (a < 0) a = -a;
+ if (b < 0) b = -b;
while (a > 0) {
T tmp = a;
a = b % a;