summaryrefslogtreecommitdiff
path: root/src/rational.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rational.cc')
-rw-r--r--src/rational.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rational.cc b/src/rational.cc
index 09dadab..47d57ad 100644
--- a/src/rational.cc
+++ b/src/rational.cc
@@ -31,3 +31,13 @@ Rational::integer () const
{
return (numerator % denominator) == 0;
}
+
+Rational
+sub::max (Rational const & a, Rational const & b)
+{
+ if (a.fraction() > b.fraction()) {
+ return a;
+ }
+
+ return b;
+}