1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/ruby/test_complex.rb: Add test for CMath.log2

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
gogotanaka 2015-06-01 06:16:53 +00:00
parent 8305152dc0
commit 900931cc7a

View file

@ -967,6 +967,10 @@ class Complex_Test < Test::Unit::TestCase
assert_in_delta(1.092, c.real, 0.001)
assert_in_delta(-0.420, c.imag, 0.001)
c = CMath.log2(Complex(1, 2))
assert_in_delta(1.161, c.real, 0.001)
assert_in_delta(1.597, c.imag, 0.001)
c = CMath.log10(Complex(1, 2))
assert_in_delta(0.349, c.real, 0.001)
assert_in_delta(0.480, c.imag, 0.001)