summaryrefslogtreecommitdiff
path: root/spec/ruby/core/complex
AgeCommit message (Collapse)Author
2025-05-09Update to ruby/spec@d8bacefAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/13265
2025-03-27Update to ruby/spec@5e579e2Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12984
2024-11-06Update to ruby/spec@54c391eBenoit Daloze
2024-03-14Update to ruby/spec@89175b2Benoit Daloze
2024-02-27Handle zero-like imaginary part as zero in to_r (#9581)Kenta Murata
Fixes [Bug #5179]
2023-04-25Update to ruby/spec@7f69c86Benoit Daloze
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 <[email protected]>
2022-04-25Update to ruby/spec@3affe1eBenoit Daloze
2021-11-02Fix typosNobuyoshi Nakada
2020-12-27Update to ruby/spec@4ce9f41Benoit Daloze
2020-12-21Use Integer instead of Fixnum/BignumNobuyoshi Nakada
2020-09-17Update to ruby/spec@e829fb0Benoit Daloze
2020-05-03Update to ruby/spec@032ee74Benoit Daloze
2020-01-28Update to ruby/spec@f8a2d54Benoit Daloze
2019-07-27Update to ruby/spec@875a09eBenoit Daloze
2019-06-19Implement Complex#<=>Jeremy Evans
Implement Complex#<=> so that it is usable as an argument when calling <=> on objects of other classes (since #coerce will coerce such numbers to Complex). If the complex number has a zero imaginary part, and the other argument is a real number (or complex number with zero imaginary part), return -1, 0, or 1. Otherwise, return nil, indicating the objects are not comparable. Fixes [Bug #15857]
2019-04-27Update to ruby/spec@15c9619Benoit 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-10-28Update to ruby/spec@a6b8805eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60525 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