diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-20 23:30:34 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-20 23:30:34 +0000 |
commit | fa59ec2f684ace2aa0c4f324d111e18427346574 (patch) | |
tree | 49e5908340b727b013eec2ec08c935ddfa679038 /rational.c | |
parent | 3aede677ba35a8dc027ce76f2b0f21e6026e22d4 (diff) | |
download | ruby-fa59ec2f684ace2aa0c4f324d111e18427346574.tar.gz |
rearrangement.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/rational.c b/rational.c index ccf214c32a..4deb54d6e2 100644 --- a/rational.c +++ b/rational.c @@ -1107,13 +1107,16 @@ nurat_to_f(VALUE self) long nl, dl, ml, ne, de; int e; double f; - get_dat1(self); - if (f_zero_p(dat->num)) - return rb_float_new(0.0); + { + get_dat1(self); + + if (f_zero_p(dat->num)) + return rb_float_new(0.0); - num = dat->num; - den = dat->den; + num = dat->num; + den = dat->den; + } if (f_negative_p(num)) { num = f_negate(num); |