From 249705229f8fa1d960af257855b44ca70668ea4d Mon Sep 17 00:00:00 2001 From: tadf Date: Sun, 7 Sep 2008 15:59:12 +0000 Subject: * rational.c: removed unused code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- rational.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'rational.c') diff --git a/rational.c b/rational.c index 44091081a0..e35b4792d9 100644 --- a/rational.c +++ b/rational.c @@ -1027,7 +1027,7 @@ nurat_to_f(VALUE self) { VALUE num, den; int minus = 0; - long nl, dl, ml, ne, de; + long nl, dl, ne, de; int e; double f; @@ -1048,7 +1048,6 @@ nurat_to_f(VALUE self) nl = i_ilog2(num); dl = i_ilog2(den); - ml = (long)(log(DBL_MAX) / log(2.0) - 1); /* should be a static */ ne = 0; if (nl > ml) { @@ -1311,10 +1310,14 @@ string_to_r_internal(VALUE self) v = f_add(v, f_to_i(fp)); v = f_div(v, l); } - if (!NIL_P(exp)) - v = f_mul(v, f_expt(INT2FIX(10), f_to_i(exp))); if (!NIL_P(si) && *StringValuePtr(si) == '-') v = f_negate(v); + if (!NIL_P(exp)) + v = f_mul(v, f_expt(INT2FIX(10), f_to_i(exp))); +#if 0 + if (!NIL_P(de) && (!NIL_P(fp) || !NIL_P(exp))) + return rb_assoc_new(v, rb_str_new2("dummy")); +#endif if (!NIL_P(de)) v = f_div(v, f_to_i(de)); -- cgit v1.2.3