summaryrefslogtreecommitdiff
path: root/src/util/integer_cln_imp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/integer_cln_imp.h')
-rw-r--r--src/util/integer_cln_imp.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/util/integer_cln_imp.h b/src/util/integer_cln_imp.h
index 8c3fc14e5..664027cdc 100644
--- a/src/util/integer_cln_imp.h
+++ b/src/util/integer_cln_imp.h
@@ -182,7 +182,8 @@ public:
return *this;
}
- /** Raise this Integer to the power <code>exp</code>.
+ /**
+ * Raise this Integer to the power <code>exp</code>.
*
* @param exp the exponent
*/
@@ -197,6 +198,21 @@ public:
}
}
+ /**
+ * Return the greatest common divisor of this integer with another.
+ */
+ Integer gcd(const Integer& y) const {
+ cln::cl_I result = cln::gcd(d_value, y.d_value);
+ return Integer(result);
+ }
+
+ /**
+ * Return the absolute value of this integer.
+ */
+ Integer abs() const {
+ return d_value >= 0 ? *this : -*this;
+ }
+
std::string toString(int base = 10) const{
std::stringstream ss;
switch(base){
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback