From fa59ec2f684ace2aa0c4f324d111e18427346574 Mon Sep 17 00:00:00 2001 From: tadf Date: Thu, 20 Mar 2008 23:30:34 +0000 Subject: [PATCH] rearrangement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ rational.c | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index cbe6692b6b..7bfe22a532 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Mar 21 08:29:33 2008 Tadayoshi Funaba + + * rational.c (nurat_to_f): rearrangement. + Fri Mar 21 06:44:59 2008 Nobuyoshi Nakada * rational.c (nurat_to_f): C99. 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); - num = dat->num; - den = dat->den; + if (f_zero_p(dat->num)) + return rb_float_new(0.0); + + num = dat->num; + den = dat->den; + } if (f_negative_p(num)) { num = f_negate(num);