| Server IP : 162.214.74.102 / Your IP : 216.73.217.21 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/Complex/ |
Upload File : |
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"AComplex object can be created as literal, and also by using ;TI"BKernel#Complex, Complex::rect, Complex::polar or to_c method.;T@o:RDoc::Markup::Verbatim;[
I"%2+1i #=> (2+1i)
;TI"%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;
@5;0@5@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@Q[I"rectangular;T@Q[:protected[ [:private[ [I"
instance;T[[;[+[I"*;T@Q[I"**;T@Q[I"+;T@Q[I"-;T@Q[I"-@;T@Q[I"/;T@Q[I"==;T@Q[I"abs;T@Q[I" abs2;T@Q[I"
angle;T@Q[I"arg;T@Q[I"as_json;F@N[I" conj;T@Q[I"conjugate;T@Q[I"denominator;T@Q[I" fdiv;T@Q[I"finite?;T@Q[I" imag;T@Q[I"imaginary;T@Q[I"infinite?;T@Q[I"inspect;T@Q[I"magnitude;T@Q[I"numerator;T@Q[I"
phase;T@Q[I"
polar;T@Q[I"quo;T@Q[I"rationalize;T@Q[I" real;T@Q[I"
real?;T@Q[I" rect;T@Q[I"rectangular;T@Q[I" to_c;T@Q[I" to_f;T@Q[I" to_i;T@Q[I"to_json;F@N[I" to_r;T@Q[I" to_s;T@Q[I"~;T@Q[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@5@8@8cRDoc::TopLevel