diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-27 03:10:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-27 03:10:12 +0000 |
commit | c1fc20124c269eab6a863e48c6647884b883de88 (patch) | |
tree | 2af8bddc38c96f414ac31d7985294eae1189f050 /test | |
parent | 8dda9460590abbde03d813ee684dfdd147f3d31d (diff) | |
download | ruby-c1fc20124c269eab6a863e48c6647884b883de88.tar.gz |
numeric.c: check signs before division
* numeric.c (ruby_num_interval_step_size): check signs and get rid
of implementation dependent behavior of negative division.
[ruby-core:61106] [Bug #9570]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_numeric.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb index 44c12ede9c..25351163b7 100644 --- a/test/ruby/test_numeric.rb +++ b/test/ruby/test_numeric.rb @@ -279,6 +279,8 @@ class TestNumeric < Test::Unit::TestCase assert_step [1], [1, 10, 2**32] assert_step [1], [1, to: 10, by: 2**32] + assert_step [], [2, 1, 3] + assert_step [], [-2, -1, -3] assert_step [3, 3, 3, 3], [3, by: 0], inf: true assert_step [10], [10, 1, -(2**32)] |