<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/spec/ruby/core/complex, branch ruby_3_2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[Bug #19004] `Complex.polar` handles complex singular `abs` argument</title>
<updated>2022-10-23T03:59:06+00:00</updated>
<author>
<name>Stephen Ierodiaconou</name>
<email>stevegeek@gmail.com</email>
</author>
<published>2022-10-23T03:59:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=54cad3123a07583c90e85bcfc55ebd87124c1250'/>
<id>54cad3123a07583c90e85bcfc55ebd87124c1250</id>
<content type='text'>
`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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to ruby/spec@3affe1e</title>
<updated>2022-04-25T12:53:54+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2022-04-25T12:53:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=45cf4f218728a15eb36d14a6c9912086525f5e3f'/>
<id>45cf4f218728a15eb36d14a6c9912086525f5e3f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typos</title>
<updated>2021-11-02T10:17:37+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-11-02T09:29:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a2024081805af4e729bea029abb7bbe7c383dce2'/>
<id>a2024081805af4e729bea029abb7bbe7c383dce2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to ruby/spec@4ce9f41</title>
<updated>2020-12-27T16:35:32+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2020-12-27T16:35:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=727c97da1977544c91b9b3677811da3a44af7d53'/>
<id>727c97da1977544c91b9b3677811da3a44af7d53</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use Integer instead of Fixnum/Bignum</title>
<updated>2020-12-20T16:19:55+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-12-20T16:16:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9c73c756244fa27ffa99d81dcc73a4ad14198002'/>
<id>9c73c756244fa27ffa99d81dcc73a4ad14198002</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to ruby/spec@e829fb0</title>
<updated>2020-09-17T09:42:26+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2020-09-17T09:42:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3f6c0a6d74209b03d0ec54b98b5e1ece40d649f0'/>
<id>3f6c0a6d74209b03d0ec54b98b5e1ece40d649f0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to ruby/spec@032ee74</title>
<updated>2020-05-03T10:28:29+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2020-05-03T10:28:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39'/>
<id>5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to ruby/spec@f8a2d54</title>
<updated>2020-01-28T19:47:48+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2020-01-28T19:47:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=809f0b8a1357f14f9645210d4812f4400c8d397e'/>
<id>809f0b8a1357f14f9645210d4812f4400c8d397e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to ruby/spec@875a09e</title>
<updated>2019-07-27T10:40:09+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2019-07-27T10:40:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0'/>
<id>5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement Complex#&lt;=&gt;</title>
<updated>2019-06-19T17:50:58+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-06-05T04:41:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b9ef35e4c6325864e013ab6e45df6fe00f759a47'/>
<id>b9ef35e4c6325864e013ab6e45df6fe00f759a47</id>
<content type='text'>
Implement Complex#&lt;=&gt; so that it is usable as an argument when
calling &lt;=&gt; 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]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement Complex#&lt;=&gt; so that it is usable as an argument when
calling &lt;=&gt; 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]
</pre>
</div>
</content>
</entry>
</feed>
