diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-10-30 08:43:28 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-10-30 08:43:28 +0000 |
commit | 54d534f04313a0437a613516169cb243b695ccaf (patch) | |
tree | 04fc0c8f6e436dbe5025298e3d61851252820e27 /bignum.c | |
parent | 864bc4f18beb189c07a22e605810bb8d6eef5645 (diff) | |
download | ruby-54d534f04313a0437a613516169cb243b695ccaf.tar.gz |
* string.c (rb_str_chomp_bang): do smart chomp if $/ == '\n'.
* io.c (rb_io_puts): don't treat Array specially.
* bignum.c (rb_big_cmp): should convert bignum to float.
* eval.c (rb_f_eval): can't modify untainted binding.
* regex.c (re_compile_pattern): should preverve p0 value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -561,7 +561,13 @@ rb_big_cmp(x, y) break; case T_FLOAT: - y = dbl2big(RFLOAT(y)->value); + { + double d = rb_big2dbl(x); + + if (d == RFLOAT(y)->value) return INT2FIX(0); + if (d > RFLOAT(y)->value) return INT2FIX(1); + if (d < RFLOAT(y)->value) return INT2FIX(-1); + } break; default: |