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/Rational/round-i.ri
U:RDoc::AnyMethod[iI"
round:ETI"Rational#round;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph;	[I"5Returns +rat+ rounded to the nearest value with ;TI":a precision of +ndigits+ decimal digits (default: 0).;To:RDoc::Markup::BlankLineo;
;	[I"FWhen the precision is negative, the returned value is an integer ;TI";with at least <code>ndigits.abs</code> trailing zeros.;T@o;
;	[I"4Returns a rational when +ndigits+ is positive, ;TI""otherwise returns an integer.;T@o:RDoc::Markup::Verbatim;	[I""Rational(3).round      #=> 3
;TI""Rational(2, 3).round   #=> 1
;TI"#Rational(-3, 2).round  #=> -2
;TI"
;TI".  #    decimal      -  1  2  3 . 4  5  6
;TI"-  #                   ^  ^  ^  ^   ^  ^
;TI"-  #   precision      -3 -2 -1  0  +1 +2
;TI"
;TI"5Rational('-123.456').round(+1).to_f  #=> -123.5
;TI"3Rational('-123.456').round(-1)       #=> -120
;T:@format0o;
;	[I"7The optional +half+ keyword argument is available ;TI"similar to Float#round.;T@o;;	[I"9Rational(25, 100).round(1, half: :up)    #=> (3/10)
;TI"8Rational(25, 100).round(1, half: :down)  #=> (1/5)
;TI"8Rational(25, 100).round(1, half: :even)  #=> (1/5)
;TI"8Rational(35, 100).round(1, half: :up)    #=> (2/5)
;TI"9Rational(35, 100).round(1, half: :down)  #=> (3/10)
;TI"8Rational(35, 100).round(1, half: :even)  #=> (2/5)
;TI":Rational(-25, 100).round(1, half: :up)   #=> (-3/10)
;TI"9Rational(-25, 100).round(1, half: :down) #=> (-1/5)
;TI"8Rational(-25, 100).round(1, half: :even) #=> (-1/5);T;
0:
@fileI"rational.c;T:0@omit_headings_from_table_of_contents_below0I"Brat.round([ndigits] [, half: mode])  ->  integer or rational
;T0[I"(*args, p2 = {});T@3FI"
Rational;TcRDoc::NormalClass00