1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

rearrangement.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2008-03-20 23:30:34 +00:00
parent 3aede677ba
commit fa59ec2f68
2 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,7 @@
Fri Mar 21 08:29:33 2008 Tadayoshi Funaba <tadf@dotrb.org>
* rational.c (nurat_to_f): rearrangement.
Fri Mar 21 06:44:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Fri Mar 21 06:44:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* rational.c (nurat_to_f): C99. * rational.c (nurat_to_f): C99.

View file

@ -1107,13 +1107,16 @@ nurat_to_f(VALUE self)
long nl, dl, ml, ne, de; long nl, dl, ml, ne, de;
int e; int e;
double f; double f;
get_dat1(self);
if (f_zero_p(dat->num)) {
return rb_float_new(0.0); get_dat1(self);
num = dat->num; if (f_zero_p(dat->num))
den = dat->den; return rb_float_new(0.0);
num = dat->num;
den = dat->den;
}
if (f_negative_p(num)) { if (f_negative_p(num)) {
num = f_negate(num); num = f_negate(num);