D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Complex
/
Filename :
to_r-i.ri
back
Copy
U:RDoc::AnyMethod[iI" to_r:ETI"Complex#to_r;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"HReturns the value of <tt>self.real</tt> as a Rational, if possible:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"5Complex.rect(1, 0).to_r # => (1/1) ;TI"5Complex.rect(1, Rational(0, 1)).to_r # => (1/1) ;TI"5Complex.rect(1, 0.0).to_r # => (1/1) ;T:@format0o; ; [I"ARaises RangeError if <tt>self.imag</tt> is not exactly zero ;TI"?(either <tt>Integer(0)</tt> or <tt>Rational(0, _n_)</tt>) ;TI"5and <tt>self.imag.to_r</tt> is not exactly zero.;T@o; ; [I""Related: Complex#rationalize.;T: @fileI"complex.c;T:0@omit_headings_from_table_of_contents_below0I"to_r -> rational ;T0[ I"();T@FI"Complex;TcRDoc::NormalClass00