diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-10 02:36:16 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-10 02:36:16 +0000 |
commit | f72be814d98f37a2f9423b46a42b35d964070d33 (patch) | |
tree | e5a8d6aba89ef69df04055fca981228a09399269 /test/test_mathn.rb | |
parent | adc9c71fbe473b18ae16b9aa0391fcbc36a39bb0 (diff) | |
download | ruby-f72be814d98f37a2f9423b46a42b35d964070d33.tar.gz |
internal.h: change the default rounding mode to half-up
* internal.h (ROUND_DEFAULT): changed to RUBY_NUM_ROUND_HALF_UP.
[Bug #12958] [ruby-core:78204]
* test/ruby/test_integer.rb: fix assertions for the above change.
* test/ruby/test_rational.rb: ditto.
* test/test_mathn.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_mathn.rb')
-rw-r--r-- | test/test_mathn.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_mathn.rb b/test/test_mathn.rb index bafc4c8dbc..00130eadf1 100644 --- a/test/test_mathn.rb +++ b/test/test_mathn.rb @@ -96,17 +96,17 @@ class TestMathn < Test::Unit::TestCase def test_round assert_separately(%w[-rmathn], <<-EOS, ignore_stderr: true) assert_equal( 3, ( 13/5).round) - assert_equal( 2, ( 5/2).round) + assert_equal( 3, ( 5/2).round) assert_equal( 2, ( 12/5).round) assert_equal(-2, (-12/5).round) - assert_equal(-2, ( -5/2).round) + assert_equal(-3, ( -5/2).round) assert_equal(-3, (-13/5).round) assert_equal( 3, ( 13/5).round(0)) - assert_equal( 2, ( 5/2).round(0)) + assert_equal( 3, ( 5/2).round(0)) assert_equal( 2, ( 12/5).round(0)) assert_equal(-2, (-12/5).round(0)) - assert_equal(-2, ( -5/2).round(0)) + assert_equal(-3, ( -5/2).round(0)) assert_equal(-3, (-13/5).round(0)) assert_equal(( 13/5), ( 13/5).round(2)) |