Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
212
/
task
/
212
/
root
/
proc
/
self
/
root
/
opt
/
ruby-2.7
/
usr
/
share
/
ri
/
2.7.0
/
system
/
Float
/
//proc/212/task/212/root/proc/self/root/opt/ruby-2.7/usr/share/ri/2.7.0/system/Float/truncate-i.ri
U:RDoc::AnyMethod[iI" truncate:ETI"Float#truncate;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"0Returns +float+ truncated (toward zero) to ;TI":a precision of +ndigits+ decimal digits (default: 0).;To:RDoc::Markup::BlankLine o; ; [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"AReturns a floating point number when +ndigits+ is positive, ;TI""otherwise returns an integer.;T@o:RDoc::Markup::Verbatim; [ I""2.8.truncate #=> 2 ;TI"#(-2.8).truncate #=> -2 ;TI"%1.234567.truncate(2) #=> 1.23 ;TI"&34567.89.truncate(-2) #=> 34500 ;T:@format0o; ; [I"BNote that the limited precision of floating point arithmetic ;TI"&might lead to surprising results:;T@o;; [I"$(0.3 / 0.1).truncate #=> 2 (!);T; 0: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"5float.truncate([ndigits]) -> integer or float ;T0[ I"(*args);T@%FI" Float;TcRDoc::NormalClass00