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
This commit is contained in:
mrkn 2016-12-10 02:36:16 +00:00
parent adc9c71fbe
commit f72be814d9
4 changed files with 11 additions and 11 deletions

View file

@ -598,10 +598,10 @@ class Rational_Test < Test::Unit::TestCase
def test_trunc
[[Rational(13, 5), [ 2, 3, 2, 3, 3, 3, 3]], # 2.6
[Rational(5, 2), [ 2, 3, 2, 2, 2, 3, 2]], # 2.5
[Rational(5, 2), [ 2, 3, 2, 3, 2, 3, 2]], # 2.5
[Rational(12, 5), [ 2, 3, 2, 2, 2, 2, 2]], # 2.4
[Rational(-12,5), [-3, -2, -2, -2, -2, -2, -2]], # -2.4
[Rational(-5, 2), [-3, -2, -2, -2, -2, -3, -2]], # -2.5
[Rational(-5, 2), [-3, -2, -2, -3, -2, -3, -2]], # -2.5
[Rational(-13, 5), [-3, -2, -2, -3, -3, -3, -3]], # -2.6
].each do |i, a|
s = proc {i.inspect}