summaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-17 17:05:31 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-17 17:05:31 +0000
commitd47819234e5e5ba3180e8c663469e6f436c8ba4b (patch)
tree0ac51273ad261916de64e100abe15d09470c39bf /numeric.c
parentd045f6eaf238d683f78ccafcc2769127c83542ce (diff)
downloadruby-d47819234e5e5ba3180e8c663469e6f436c8ba4b.tar.gz
ruby-d47819234e5e5ba3180e8c663469e6f436c8ba4b.tar.xz
ruby-d47819234e5e5ba3180e8c663469e6f436c8ba4b.zip
* numeric.c (flo_cmp): Infinity is greater than any bignum
number. [ruby-dev:38672] * bignum.c (rb_big_cmp): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index a4ccd01b5..74061fc69 100644
--- a/numeric.c
+++ b/numeric.c
@@ -943,6 +943,10 @@ flo_cmp(VALUE x, VALUE y)
break;
case T_BIGNUM:
+ if (isinf(a)) {
+ if (a > 0.0) return INT2FIX(1);
+ else return INT2FIX(-1);
+ }
b = rb_big2dbl(y);
break;