aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rational.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rational.c b/rational.c
index 1e40841bee..67752ff961 100644
--- a/rational.c
+++ b/rational.c
@@ -1924,6 +1924,7 @@ integer_denominator(VALUE self)
return INT2FIX(1);
}
+static VALUE float_to_r(VALUE self);
/*
* call-seq:
* flo.numerator -> integer
@@ -1940,7 +1941,7 @@ float_numerator(VALUE self)
double d = RFLOAT_VALUE(self);
if (isinf(d) || isnan(d))
return self;
- return rb_call_super(0, 0);
+ return nurat_numerator(float_to_r(self));
}
/*
@@ -1958,7 +1959,7 @@ float_denominator(VALUE self)
double d = RFLOAT_VALUE(self);
if (isinf(d) || isnan(d))
return INT2FIX(1);
- return rb_call_super(0, 0);
+ return nurat_denominator(float_to_r(self));
}
/*