aboutsummaryrefslogtreecommitdiff
path: root/builtin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.cpp')
-rw-r--r--builtin.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin.cpp b/builtin.cpp
index 610cdec..94fcd9b 100644
--- a/builtin.cpp
+++ b/builtin.cpp
@@ -327,6 +327,7 @@ RatNumObj *RatNumObj::from_string(string repr) {
try
{
mpq_class ret(repr, 10);
+ ret.canonicalize();
return new RatNumObj(ret);
}
catch (std::invalid_argument &e)