D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Integer
/
Filename :
ceil-i.ri
back
Copy
U:RDoc::AnyMethod[iI" ceil:ETI"Integer#ceil;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"�Returns an integer that is a "ceiling" value for <code>self</code>, as specified by the given <code>ndigits</code>, which must be an {integer-convertible object}[rdoc-ref:implicit_conversion.rdoc@Integer-Convertible+Objects].;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"dWhen <code>self</code> is zero, returns zero (regardless of the value of <code>ndigits</code>):;Fo:RDoc::Markup::Verbatim; [I")0.ceil(2) # => 0 0.ceil(-2) # => 0 ;F:@format0o;;0; [o; ; [I"lWhen <code>self</code> is non-zero and <code>ndigits</code> is non-negative, returns <code>self</code>:;Fo;; [I"1555.ceil # => 555 555.ceil(50) # => 555 ;F;0o;;0; [o; ; [I"When <code>self</code> is non-zero and <code>ndigits</code> is negative, returns a value based on a computed granularity:;Fo;;; ;[o;;0; [o; ; [I"7The granularity is <code>10 ** ndigits.abs</code>.;Fo;;0; [o; ; [I"xThe returned value is the smallest multiple of the granularity that is greater than or equal to <code>self</code>.;Fo; ; [I".Examples with positive <code>self</code>:;Fo:RDoc::Markup::Table:@header[I"ndigits;FI"Granularity;FI"1234.ceil(ndigits);F:@align[: right;;: @body[ [I"-1;FI"10;FI" 1240;F[I"-2;FI"100;FI" 1300;F[I"-3;FI" 1000;FI" 2000;F[I"-4;FI" 10000;FI" 10000;F[I"-5;FI"100000;FI"100000;Fo; ; [I".Examples with negative <code>self</code>:;Fo;;[I"ndigits;FI"Granularity;FI"-1234.ceil(ndigits);F;[;;;;[ [I"-1;FI"10;FI" -1230;F[I"-2;FI"100;FI" -1200;F[I"-3;FI" 1000;FI" -1000;F[I"-4;FI" 10000;FI"0;F[I"-5;FI"100000;FI"0;Fo; ; [I"Related: Integer#floor.;T: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I""ceil(ndigits = 0) -> integer ;T0[ I"(*args);T@pFI"Integer;TcRDoc::NormalClass00