HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
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::BlankLineo: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