1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core
nagachika 597ce7966c merge revision(s) 54cad3123a: [Backport #19004]
[Bug #19004] `Complex.polar` handles complex singular `abs` argument

	`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.
	---
	 complex.c                            | 13 ++++++-------
	 spec/ruby/core/complex/polar_spec.rb | 16 ++++++++++++++++
	 2 files changed, 22 insertions(+), 7 deletions(-)
2022-11-05 14:24:03 +09:00
..
argf
array Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
basicobject
binding
builtin_constants
class Remove Class#descendants 2021-12-20 11:02:15 -08:00
comparable
complex merge revision(s) 54cad3123a: [Backport #19004] 2022-11-05 14:24:03 +09:00
conditionvariable
data
dir Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
encoding Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
enumerable Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
enumerator Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
env
exception Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
false
fiber
file
filetest
float
gc Fix GC.total_time example 2021-11-30 08:49:41 +09:00
hash
integer Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
io Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
kernel Restore the global random seed 2021-12-16 17:44:12 +09:00
main
marshal
matchdata Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
math
method merge revision(s) 94cea3e4d0a60326bd95be762819eed8ccd59ca6,aa53d69aa21c4dfa2a78a1cec5cb34e9697b3d30,6b7d32a5e54088b6b4014529bbf2b4b8c1a96029,c6319026caa6c8f0f569f80011e8502349a04b14,aa490f9442c32cd0e1e449ac817f410bd5924c8b: [Backport #18435] 2022-10-01 15:32:44 +09:00
module
mutex
nil
numeric Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
objectspace
proc
process
queue
random
range merge revision(s) bbe5ec7846: [Backport #18994] 2022-10-23 19:11:45 +09:00
rational
regexp
signal
sizedqueue
string Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
struct
symbol
systemexit
thread
threadgroup
time Re-enable example for Europe/Amsterdam pre-1970 time 2022-10-01 20:29:30 +09:00
tracepoint
true
unboundmethod merge revision(s) 94cea3e4d0a60326bd95be762819eed8ccd59ca6,aa53d69aa21c4dfa2a78a1cec5cb34e9697b3d30,6b7d32a5e54088b6b4014529bbf2b4b8c1a96029,c6319026caa6c8f0f569f80011e8502349a04b14,aa490f9442c32cd0e1e449ac817f410bd5924c8b: [Backport #18435] 2022-10-01 15:32:44 +09:00
warning Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00