From 8a87549315d0c7fd984a8ad239ebe3dbab4d2855 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 14 Aug 2020 14:34:53 +0900 Subject: Rename float configuration option names. - `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general. --- mrbgems/mruby-complex/test/complex.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mrbgems/mruby-complex/test') diff --git a/mrbgems/mruby-complex/test/complex.rb b/mrbgems/mruby-complex/test/complex.rb index d996e8277..14711ad73 100644 --- a/mrbgems/mruby-complex/test/complex.rb +++ b/mrbgems/mruby-complex/test/complex.rb @@ -60,7 +60,7 @@ assert 'Complex#/' do assert_complex Complex(9, 8) / 4 , ((9 / 4) + 2i) assert_complex Complex(20, 9) / 9.8 , (2.0408163265306123 + 0.9183673469387754i) if 1e39.infinite? then - # MRB_USE_FLOAT in effect + # MRB_USE_FLOAT32 in effect ten = 1e21 one = 1e20 else @@ -80,7 +80,7 @@ assert 'Complex#abs' do assert_float Complex(-1).abs, 1 assert_float Complex(3.0, -4.0).abs, 5.0 if 1e39.infinite? then - # MRB_USE_FLOAT in effect + # MRB_USE_FLOAT32 in effect exp = 125 else exp = 1021 -- cgit v1.2.3 From ed32b6fcdc0acc9e70f21a9df8e85d20ec662185 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 18 Aug 2020 13:15:34 +0900 Subject: Update tests for integer division. --- mrbgems/mruby-complex/test/complex.rb | 4 ++-- test/t/numeric.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'mrbgems/mruby-complex/test') diff --git a/mrbgems/mruby-complex/test/complex.rb b/mrbgems/mruby-complex/test/complex.rb index 14711ad73..8f9634048 100644 --- a/mrbgems/mruby-complex/test/complex.rb +++ b/mrbgems/mruby-complex/test/complex.rb @@ -56,8 +56,8 @@ end assert 'Complex#/' do assert_complex Complex(2, 3) / Complex(2, 3) , (1 + 0i) assert_complex Complex(900) / Complex(1) , (900 + 0i) - assert_complex Complex(-2, 9) / Complex(-9, 2), ((36 / 85) - (77i / 85)) - assert_complex Complex(9, 8) / 4 , ((9 / 4) + 2i) + assert_complex Complex(-2, 9) / Complex(-9, 2), ((36.0 / 85) - (77i / 85)) + assert_complex Complex(9, 8) / 4 , ((9.0 / 4) + 2i) assert_complex Complex(20, 9) / 9.8 , (2.0408163265306123 + 0.9183673469387754i) if 1e39.infinite? then # MRB_USE_FLOAT32 in effect diff --git a/test/t/numeric.rb b/test/t/numeric.rb index af44a2e1a..8baf6c883 100644 --- a/test/t/numeric.rb +++ b/test/t/numeric.rb @@ -36,7 +36,7 @@ assert('Numeric#/', '15.2.8.3.4') do n = Class.new(Numeric){ def /(x); 15.1;end }.new assert_equal(2, 10/5) - assert_equal(0.0625, 1/16) + assert_equal(0, 1/16) assert_equal(15.1, n/10) assert_raise(TypeError){ 1/n } assert_raise(TypeError){ 1/nil } -- cgit v1.2.3