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:
parent
3aede677ba
commit
fa59ec2f68
2 changed files with 12 additions and 5 deletions
|
@ -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>
|
||||
|
||||
* rational.c (nurat_to_f): C99.
|
||||
|
|
13
rational.c
13
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);
|
||||
|
|
Loading…
Reference in a new issue