summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/rational.c b/rational.c
index 1582f11..652f5ac 100644
--- a/rational.c
+++ b/rational.c
@@ -494,6 +494,8 @@ nurat_canonicalization(int f)
{
canonicalization = f;
}
+#else
+# define canonicalization <<<No canonicalization>>>
#endif
inline static void
@@ -1867,10 +1869,13 @@ numeric_quo(VALUE x, VALUE y)
return f_fdiv(x, y);
}
+#ifdef CANON
if (canonicalization) {
x = rb_rational_raw1(x);
}
- else {
+ else
+#endif
+ {
x = rb_convert_type(x, T_RATIONAL, "Rational", "to_r");
}
return rb_funcall(x, '/', 1, y);