Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby21
/
share
/
ri
/
2.1.0
/
system
/
Complex
/
//opt/alt/ruby21/share/ri/2.1.0/system/Complex/cdesc-Complex.ri
U:RDoc::NormalClass[iI"Complex:ET@I"Numeric;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[ I"FA complex number can be represented as a paired real number with ;TI"Fimaginary unit; a+bi. Where a is real part, b is imaginary part ;TI":and i is imaginary unit. Real a equals complex a+0i ;TI"mathematically.;To:RDoc::Markup::BlankLine o; ;[I"IIn ruby, you can create complex object with Complex, Complex::rect, ;TI"#Complex::polar or to_c method.;T@o:RDoc::Markup::Verbatim;[ I"%Complex(1) #=> (1+0i) ;TI"%Complex(2, 3) #=> (2+3i) ;TI"HComplex.polar(2, 3) #=> (-1.9799849932008908+0.2822400161197344i) ;TI"%3.to_c #=> (3+0i) ;T:@format0o; ;[I"GYou can also create complex object from floating-point numbers or ;TI" strings.;T@o;;[I"'Complex(0.3) #=> (0.3+0i) ;TI")Complex('0.3-0.5i') #=> (0.3-0.5i) ;TI".Complex('2/3+3/4i') #=> ((2/3)+(3/4)*i) ;TI"HComplex('1@2') #=> (-0.4161468365471424+0.9092974268256817i) ;TI" ;TI"'0.3.to_c #=> (0.3+0i) ;TI")'0.3-0.5i'.to_c #=> (0.3-0.5i) ;TI".'2/3+3/4i'.to_c #=> ((2/3)+(3/4)*i) ;TI"H'1@2'.to_c #=> (-0.4161468365471424+0.9092974268256817i) ;T;0o; ;[I">A complex object is either an exact or an inexact number.;T@o;;[I".Complex(1, 1) / 2 #=> ((1/2)+(1/2)*i) ;TI"(Complex(1, 1) / 2.0 #=> (0.5+0.5i);T;0: @fileI"complex.c;T:0@omit_headings_from_table_of_contents_below0o;;[ ; I"%ext/json/lib/json/add/complex.rb;T;0; 0;0[ [U:RDoc::Constant[i I"I;TI"Complex::I;T00o;;[o; ;[I"The imaginary unit.;T; @4;0@4@cRDoc::NormalClass0[ [[I" class;T[[:public[ [I"json_create;FI"%ext/json/lib/json/add/complex.rb;T[I" polar;TI"complex.c;T[I" rect;T@P[I"rectangular;T@P[:protected[ [:private[ [I" instance;T[[;[)[I"*;T@P[I"**;T@P[I"+;T@P[I"-;T@P[I"-@;T@P[I"/;T@P[I"==;T@P[I"abs;T@P[I" abs2;T@P[I" angle;T@P[I"arg;T@P[I"as_json;F@M[I" conj;T@P[I"conjugate;T@P[I"denominator;T@P[I" fdiv;T@P[I" imag;T@P[I"imaginary;T@P[I"inspect;T@P[I"magnitude;T@P[I"numerator;T@P[I" phase;T@P[I" polar;T@P[I"quo;T@P[I"rationalize;T@P[I" real;T@P[I" real?;T@P[I" rect;T@P[I"rectangular;T@P[I" to_c;T@P[I" to_f;T@P[I" to_i;T@P[I"to_json;F@M[I" to_r;T@P[I" to_s;T@P[I"~;T@P[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0;0[@4@7@7cRDoc::TopLevel