diff options
author | Kouhei Yanagita <yanagi@shakenbu.org> | 2023-10-14 08:50:59 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-10-14 11:22:42 +0900 |
commit | b28c1d2c5644c726bba60cd35ce9313da6e86a4f (patch) | |
tree | 48902331bfab04912c91760e615c1b668f58dbae /numeric.c | |
parent | 25072d2e878ea6093f04c67e90c5cef33d70080a (diff) | |
download | ruby-b28c1d2c5644c726bba60cd35ce9313da6e86a4f.tar.gz |
[Bug #19926] Fix Range#size for ranges with a Rational endpoint
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2834,7 +2834,7 @@ ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl) } if (RTEST(rb_funcall(from, cmp, 1, to))) return INT2FIX(0); result = rb_funcall(rb_funcall(to, '-', 1, from), id_div, 1, step); - if (!excl || RTEST(rb_funcall(rb_funcall(from, '+', 1, rb_funcall(result, '*', 1, step)), cmp, 1, to))) { + if (!excl || RTEST(rb_funcall(to, cmp, 1, rb_funcall(from, '+', 1, rb_funcall(result, '*', 1, step))))) { result = rb_funcall(result, '+', 1, INT2FIX(1)); } return result; |