aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/rational.cpp5
-rw-r--r--common/rational.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/common/rational.cpp b/common/rational.cpp
index 90e44576a7..84c1e4bee0 100644
--- a/common/rational.cpp
+++ b/common/rational.cpp
@@ -51,6 +51,11 @@ Rational::Rational(int num, int denom) {
cancel();
}
+Rational::Rational(const Rational &rational) {
+ _num = rational._num;
+ _denom = rational._denom;
+}
+
void Rational::cancel() {
// Cancel the fraction by dividing both the num and the denom
// by their greatest common divisor.
diff --git a/common/rational.h b/common/rational.h
index 89caaf25b4..bd240c99f3 100644
--- a/common/rational.h
+++ b/common/rational.h
@@ -34,6 +34,7 @@ public:
Rational();
Rational(int num);
Rational(int num, int denom);
+ Rational(const Rational &rational);
Rational &operator=(const Rational &right);
Rational &operator=(int right);