summaryrefslogtreecommitdiff
path: root/spec/ruby/core/complex/polar_spec.rb
AgeCommit message (Collapse)Author
2022-10-23[Bug #19004] `Complex.polar` handles complex singular `abs` argumentStephen Ierodiaconou
`Complex.polar` accepts Complex values as arguments for the polar form as long as the value of the complex has no imaginary part (ie it is 'real'). In `f_complex_polar` this is handled by extracting the real part of the arguments. However in the case `polar` is called with only a single argument, the absolute value (abs), then the Complex is created without applying a check on the type of abs, meaning it is possible to create a Complex where the real part is itself an instance of a Complex. This change removes the short circuit for the single argument case meaning the real part extraction is performed correctly (by f_complex_polar). Also adds an example to `spec/ruby/core/complex/polar_spec.rb` to check that the real part of a complex argument is correctly extracted and used in the resulting Complex real and imaginary parts. Notes: Merged: https://github.com/ruby/ruby/pull/6568 Merged-By: nobu <nobu@ruby-lang.org>
2019-07-27Update to ruby/spec@875a09eBenoit Daloze
2018-09-25Update to ruby/spec@241f9e7eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-04Update to ruby/spec@c1b568beregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-29Update to ruby/spec@83063a3eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20Move spec/rubyspec to spec/ruby for consistencyeregon
* Other ruby implementations use the spec/ruby directory. [Misc #13792] [ruby-core:82287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e