File: //usr/share/ri/3.0.0/system/String/to_r-i.ri
U:RDoc::AnyMethod[iI" to_r:ETI"String#to_r;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"DReturns the result of interpreting leading characters in +str+ ;TI"Bas a rational. Leading whitespace and extraneous characters ;TI"1past the end of a valid number are ignored. ;TI"8Digit sequences can be separated by an underscore. ;TI";If there is not a valid number at the start of +str+, ;TI">zero is returned. This method never raises an exception.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I""' 2 '.to_r #=> (2/1)
;TI"$'300/2'.to_r #=> (150/1)
;TI"$'-9.2'.to_r #=> (-46/5)
;TI"%'-9.2e2'.to_r #=> (-920/1)
;TI"('1_234_567'.to_r #=> (1234567/1)
;TI"#'21 June 09'.to_r #=> (21/1)
;TI""'21/06/09'.to_r #=> (7/2)
;TI""'BWV 1079'.to_r #=> (0/1)
;T:@format0o;
; [I"ANOTE: "0.3".to_r isn't the same as 0.3.to_r. The former is ;TI"8equivalent to "3/10".to_r, but the latter isn't so.;T@o;; [I"#"0.3".to_r == 3/10r #=> true
;TI"$0.3.to_r == 3/10r #=> false
;T;
0o;
; [I"See also Kernel#Rational.;T:
@fileI"rational.c;T:0@omit_headings_from_table_of_contents_below0I"str.to_r -> rational
;T0[ I"();T@)FI"String;TcRDoc::NormalClass00