PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Integer
U:RDoc::AnyMethod[iI" round:ETI"Integer#round;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Returns +self+ rounded to the nearest value with ;TI"-a precision of +ndigits+ decimal digits.;To:RDoc::Markup::BlankLine o; ; [I"4When +ndigits+ is negative, the returned value ;TI"6has at least <tt>ndigits.abs</tt> trailing zeros:;T@o:RDoc::Markup::Verbatim; [ I"!555.round(-1) # => 560 ;TI"!555.round(-2) # => 600 ;TI""555.round(-3) # => 1000 ;TI""-555.round(-2) # => -600 ;TI"555.round(-4) # => 0 ;T:@format0o; ; [I"7Returns +self+ when +ndigits+ is zero or positive.;T@o;; [I"555.round # => 555 ;TI"555.round(1) # => 555 ;TI"555.round(50) # => 555 ;T; 0o; ; [I"*If keyword argument +half+ is given, ;TI"?and +self+ is equidistant from the two candidate values, ;TI"9the rounding is according to the given +half+ value:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"*+:up+ or +nil+: round away from zero:;T@o;; [I"*25.round(-1, half: :up) # => 30 ;TI"+(-25).round(-1, half: :up) # => -30 ;T; 0o;;0; [o; ; [I" +:down+: round toward zero:;T@o;; [I"*25.round(-1, half: :down) # => 20 ;TI"+(-25).round(-1, half: :down) # => -20 ;T; 0o;;0; [o; ; [I"J+:even+: round toward the candidate whose last nonzero digit is even:;T@o;; [I"*25.round(-1, half: :even) # => 20 ;TI"*15.round(-1, half: :even) # => 20 ;TI"+(-25).round(-1, half: :even) # => -20 ;T; 0o; ; [I"=Raises and exception if the value for +half+ is invalid.;T@o; ; [I"Related: Integer#truncate.;T: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"-round(ndigits= 0, half: :up) -> integer ;T0[ I"(p1 = v1, p2 = {});T@LFI"Integer;TcRDoc::NormalClass00
[-] chr-i.ri
[edit]
[-] coerce-i.ri
[edit]
[-] to_f-i.ri
[edit]
[-] bit_length-i.ri
[edit]
[-] %2d-i.ri
[edit]
[-] anybits%3f-i.ri
[edit]
[-] integer%3f-i.ri
[edit]
[-] allbits%3f-i.ri
[edit]
[-] upto-i.ri
[edit]
[-] magnitude-i.ri
[edit]
[-] size-i.ri
[edit]
[-] %7c-i.ri
[edit]
[-] try_convert-c.ri
[edit]
[-] %3c%3c-i.ri
[edit]
[-] to_s-i.ri
[edit]
[-] %2a-i.ri
[edit]
[-] %3c%3d-i.ri
[edit]
[-] nobits%3f-i.ri
[edit]
[-] %3c-i.ri
[edit]
[-] numerator-i.ri
[edit]
[-] %3c%3d%3e-i.ri
[edit]
[-] rationalize-i.ri
[edit]
[-] modulo-i.ri
[edit]
[-] remainder-i.ri
[edit]
[-] ceil-i.ri
[edit]
[-] to_r-i.ri
[edit]
[-] sqrt-c.ri
[edit]
[-] cdesc-Integer.ri
[edit]
[-] %2a%2a-i.ri
[edit]
[-] %26-i.ri
[edit]
[-] downto-i.ri
[edit]
[-] %3e-i.ri
[edit]
[-] floor-i.ri
[edit]
[-] divmod-i.ri
[edit]
[-] round-i.ri
[edit]
[-] to_int-i.ri
[edit]
[-] %2d%40-i.ri
[edit]
[-] denominator-i.ri
[edit]
[-] %2f-i.ri
[edit]
[-] abs-i.ri
[edit]
[-] zero%3f-i.ri
[edit]
[-] %3d%3d%3d-i.ri
[edit]
[-] to_bn-i.ri
[edit]
[-] odd%3f-i.ri
[edit]
[-] times-i.ri
[edit]
[-] pred-i.ri
[edit]
[-] %25-i.ri
[edit]
[-] to_i-i.ri
[edit]
[-] %5b%5d-i.ri
[edit]
[-] truncate-i.ri
[edit]
[-] digits-i.ri
[edit]
[-] %3e%3e-i.ri
[edit]
[-] pow-i.ri
[edit]
[+]
..
[-] gcdlcm-i.ri
[edit]
[-] fdiv-i.ri
[edit]
[-] %2b-i.ri
[edit]
[-] %3e%3d-i.ri
[edit]
[-] even%3f-i.ri
[edit]
[-] lcm-i.ri
[edit]
[-] succ-i.ri
[edit]
[-] %3d%3d-i.ri
[edit]
[-] ceildiv-i.ri
[edit]
[-] div-i.ri
[edit]
[-] inspect-i.ri
[edit]
[-] %7e-i.ri
[edit]
[-] gcd-i.ri
[edit]
[-] %5e-i.ri
[edit]
[-] ord-i.ri
[edit]
[-] next-i.ri
[edit]