diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-15 18:31:06 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-10-15 18:31:06 +0900 |
| commit | 9cebddf9fe83ae0acde6f64f291fa3c9fc22880f (patch) | |
| tree | 6f9ca4f2941c3da48a504c937719adca36e4cdfe /mrbgems/mruby-math/test/math.rb | |
| parent | 8c276f95be2f4e9deed73f08125a23a6746cb517 (diff) | |
| parent | 21e07d61138a87891dc780efaa28e6c76a39378f (diff) | |
| download | mruby-9cebddf9fe83ae0acde6f64f291fa3c9fc22880f.tar.gz mruby-9cebddf9fe83ae0acde6f64f291fa3c9fc22880f.zip | |
Merge pull request #5084 from mruby/mruby3
Mruby3
Diffstat (limited to 'mrbgems/mruby-math/test/math.rb')
| -rw-r--r-- | mrbgems/mruby-math/test/math.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mrbgems/mruby-math/test/math.rb b/mrbgems/mruby-math/test/math.rb index d2790e289..959eef788 100644 --- a/mrbgems/mruby-math/test/math.rb +++ b/mrbgems/mruby-math/test/math.rb @@ -209,17 +209,18 @@ assert('Math.atan2') do assert_float(+Math::PI, Math.atan2(+0.0, -0.0)) assert_float(-Math::PI, Math.atan2(-0.0, -0.0)) + assert_float(0, Math.atan2(0, 1)) + assert_float(Math::PI / 4, Math.atan2(1, 1)) + assert_float(Math::PI / 2, Math.atan2(1, 0)) + inf = Float::INFINITY + skip "Math.atan2() return NaN" if Math.atan2(+inf, -inf).nan? expected = 3.0 * Math::PI / 4.0 assert_float(+expected, Math.atan2(+inf, -inf)) assert_float(-expected, Math.atan2(-inf, -inf)) expected = Math::PI / 4.0 assert_float(+expected, Math.atan2(+inf, +inf)) assert_float(-expected, Math.atan2(-inf, +inf)) - - assert_float(0, Math.atan2(0, 1)) - assert_float(Math::PI / 4, Math.atan2(1, 1)) - assert_float(Math::PI / 2, Math.atan2(1, 0)) end assert('Math.ldexp') do |
