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

compare with correct values

* spec/ruby/shared/rational/exponent.rb: compare with
  mathematically expected values without errors.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-06-17 01:24:25 +00:00
parent f12cc0e6f7
commit 90d0655307

View file

@ -115,9 +115,9 @@ describe :rational_exponent, shared: true do
end
it "returns a complex number if self is negative and the passed argument is not 0" do
(Rational(-3, 2) ** 1.5).should be_close(Complex(-3.374618290464398e-16, -1.8371173070873836), TOLERANCE)
(Rational(3, -2) ** 1.5).should be_close(Complex(-3.374618290464398e-16, -1.8371173070873836), TOLERANCE)
(Rational(3, -2) ** -1.5).should be_close(Complex(-9.998869008783402e-17, 0.5443310539518174), TOLERANCE)
(Rational(-3, 2) ** 1.5).should be_close(Complex(0.0, -1.8371173070873836), TOLERANCE)
(Rational(3, -2) ** 1.5).should be_close(Complex(0.0, -1.8371173070873836), TOLERANCE)
(Rational(3, -2) ** -1.5).should be_close(Complex(0.0, 0.5443310539518174), TOLERANCE)
end
it "returns Complex(1.0) when the passed argument is 0.0" do