diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-07 15:59:12 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-07 15:59:12 +0000 |
commit | 249705229f8fa1d960af257855b44ca70668ea4d (patch) | |
tree | 76e0bc735dc38d6e640e7679f7b12a322bff9a82 /rational.c | |
parent | d4832b7aac602e22d775ce1d71551759b1710f0c (diff) | |
download | ruby-249705229f8fa1d960af257855b44ca70668ea4d.tar.gz |
* rational.c: removed unused code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 11 |
1 files changed, 7 insertions, 4 deletions
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)); |