ÿØÿà JFIF ÿÛ „ ( %!1!%*+...983,7(-.-
%25-i.ri 0000644 00000001742 15237337534 0005641 0 ustar 00 U:RDoc::AnyMethod[iI"%:ETI"Float#%;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I".Returns +self+ modulo +other+ as a float.;To:RDoc::Markup::BlankLine o;
; [I"IFor float +f+ and real number +r+, these expressions are equivalent:;T@o:RDoc::Markup::Verbatim; [I"f % r
;TI"f-r*(f/r).floor
;TI"f.divmod(r)[1]
;T:@format0o;
; [I"See Numeric#divmod.;T@o;
; [I"Examples:;T@o;; [I"$10.0 % 2 # => 0.0
;TI"$10.0 % 3 # => 1.0
;TI"$10.0 % 4 # => 2.0
;TI"
;TI"$10.0 % -2 # => 0.0
;TI"%10.0 % -3 # => -2.0
;TI"%10.0 % -4 # => -2.0
;TI"
;TI"$10.0 % 4.0 # => 2.0
;TI"$10.0 % Rational(4, 1) # => 2.0
;T;
0o;
; [I"*Float#modulo is an alias for Float#%.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"self % other -> float
;T0[[I"modulo;T@ I" (p1);T@,FI"
Float;TcRDoc::NormalClass00 to_r-i.ri 0000644 00000001470 15237337534 0006307 0 ustar 00 U:RDoc::AnyMethod[iI" to_r:ETI"Float#to_r;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"%Returns the value as a rational.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"2.0.to_r #=> (2/1)
;TI"2.5.to_r #=> (5/2)
;TI"-0.75.to_r #=> (-3/4)
;TI"0.0.to_r #=> (0/1)
;TI":0.3.to_r #=> (5404319552844595/18014398509481984)
;T:@format0o;
; [I"ANOTE: 0.3.to_r isn't the same as "0.3".to_r. The latter is ;TI"8equivalent to "3/10".to_r, but the former isn't so.;T@o;; [I"$0.3.to_r == 3/10r #=> false
;TI"#"0.3".to_r == 3/10r #=> true
;T;
0o;
; [I" See also Float#rationalize.;T:
@fileI"rational.c;T:0@omit_headings_from_table_of_contents_below0I"flt.to_r -> rational
;T0[ I"();T@!FI"
Float;TcRDoc::NormalClass00 phase-i.ri 0000644 00000000500 15237337534 0006435 0 ustar 00 U:RDoc::AnyMethod[iI"
phase:ETI"Float#phase;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Returns 0 if the value is positive, pi otherwise.;T:
@fileI"complex.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"
Float;TcRDoc::NormalClass0[@FI"arg;T round-i.ri 0000644 00000004026 15237337534 0006473 0 ustar 00 U:RDoc::AnyMethod[iI"
round:ETI"Float#round;TF:privateo: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"DWhen +ndigits+ is non-negative, returns a float with +ndigits+ ;TI",after the decimal point (as available):;T@o:RDoc::Markup::Verbatim; [I"f = 12345.6789
;TI"f.round(1) # => 12345.7
;TI"f.round(3) # => 12345.679
;TI"f = -12345.6789
;TI"f.round(1) # => -12345.7
;TI" f.round(3) # => -12345.679
;T:@format0o;
; [I"4When +ndigits+ is negative, returns an integer ;TI"7with at least ndigits.abs trailing zeros:;T@o;; [I"f = 12345.6789
;TI"f.round(0) # => 12346
;TI"f.round(-3) # => 12000
;TI"f = -12345.6789
;TI"f.round(0) # => -12346
;TI"f.round(-3) # => -12000
;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"&2.5.round(half: :up) # => 3
;TI"&3.5.round(half: :up) # => 4
;TI"'(-2.5).round(half: :up) # => -3
;T;
0o;;0; [o;
; [I" +:down+: round toward zero:;T@o;; [I"&2.5.round(half: :down) # => 2
;TI"&3.5.round(half: :down) # => 3
;TI"'(-2.5).round(half: :down) # => -2
;T;
0o;;0; [o;
; [I"J+:even+: round toward the candidate whose last nonzero digit is even:;T@o;; [I"&2.5.round(half: :even) # => 2
;TI"&3.5.round(half: :even) # => 4
;TI"'(-2.5).round(half: :even) # => -2
;T;
0o;
; [I"=Raises and exception if the value for +half+ is invalid.;T@o;
; [I"Related: Float#truncate.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"8round(ndigits = 0, half: :up]) -> integer or float
;T0[ I"(p1 = v1, p2 = {});T@SFI"
Float;TcRDoc::NormalClass00 inspect-i.ri 0000644 00000001754 15237337534 0007016 0 ustar 00 U:RDoc::AnyMethod[iI"inspect:ETI"Float#inspect;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"=Returns a string containing a representation of +self+; ;TI"Adepending of the value of +self+, the string representation ;TI"may contain:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List:
@type:BULLET:@items[
o:RDoc::Markup::ListItem:@label0; [o;
; [I"A fixed-point number.;To;;0; [o;
; [I"@A number in "scientific notation" (containing an exponent).;To;;0; [o;
; [I"'Infinity'.;To;;0; [o;
; [I"'-Infinity'.;To;;0; [o;
; [I"%'NaN' (indicating not-a-number).;T@o;
; [
I"#3.14.to_s # => "3.14" ;TI"4(10.1**50).to_s # => "1.644631821843879e+50" ;TI"'(10.1**500).to_s # => "Infinity" ;TI"((-10.1**500).to_s # => "-Infinity" ;TI"!(0.0/0.0).to_s # => "NaN";T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@3FI"
Float;TcRDoc::NormalClass0[@6FI" to_s;T fdiv-i.ri 0000644 00000001157 15237337534 0006276 0 ustar 00 U:RDoc::AnyMethod[iI" fdiv:ETI"Float#fdiv;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I":Returns the quotient from dividing +self+ by +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"f = 3.14
;TI"%f.quo(2) # => 1.57
;TI"&f.quo(-2) # => -1.57
;TI"%f.quo(Rational(2, 1)) # => 1.57
;TI",f.quo(Complex(2, 0)) # => (1.57+0.0i)
;T:@format0o;
; [I"*Float#fdiv is an alias for Float#quo.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below000[ I" (p1);T@FI"
Float;TcRDoc::NormalClass0[@FI"quo;T prev_float-i.ri 0000644 00000002564 15237337534 0007512 0 ustar 00 U:RDoc::AnyMethod[iI"prev_float:ETI"Float#prev_float;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"3Returns the next-smaller representable \Float.;To:RDoc::Markup::BlankLine o;
; [I"KThese examples show the internally stored values (64-bit hexadecimal) ;TI"Hfor each \Float +f+ and for the corresponding f.pev_float:;T@o:RDoc::Markup::Verbatim; [
I"'f = 5e-324 # 0x0000000000000001
;TI"'f.prev_float # 0x0000000000000000
;TI"
;TI"'f = 0.01 # 0x3f847ae147ae147b
;TI"'f.prev_float # 0x3f847ae147ae147a
;T:@format0o;
; [I"JIn the remaining examples here, the output is shown in the usual way ;TI"(result +to_s+):;T@o;; [I"10.01.prev_float # => 0.009999999999999998
;TI"/1.0.prev_float # => 0.9999999999999999
;TI".100.0.prev_float # => 99.99999999999999
;TI"
;TI"f = 0.01
;TI"[(0..3).each_with_index {|i| printf "%2d %-20a %s\n", i, f, f.to_s; f = f.prev_float }
;T;
0o;
; [I"Output:;T@o;; [ I"!0 0x1.47ae147ae147bp-7 0.01
;TI"11 0x1.47ae147ae147ap-7 0.009999999999999998
;TI"12 0x1.47ae147ae1479p-7 0.009999999999999997
;TI"13 0x1.47ae147ae1478p-7 0.009999999999999995
;T;
0o;
; [I"Related: Float#next_float.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"!float.prev_float -> float
;T0[ I"();T@2FI"
Float;TcRDoc::NormalClass00 arg-i.ri 0000644 00000000642 15237337534 0006115 0 ustar 00 U:RDoc::AnyMethod[iI"arg:ETI"Float#arg;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Returns 0 if the value is positive, pi otherwise.;T:
@fileI"complex.c;T:0@omit_headings_from_table_of_contents_below0I"Sflo.arg -> 0 or float
flo.angle -> 0 or float
flo.phase -> 0 or float
;T0[[I"
angle;T@ [I"
phase;T@ I"();T@FI"
Float;TcRDoc::NormalClass00 rationalize-i.ri 0000644 00000001326 15237337534 0007665 0 ustar 00 U:RDoc::AnyMethod[iI"rationalize:ETI"Float#rationalize;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"GReturns a simpler approximation of the value (flt-|eps| <= result ;TI"B<= flt+|eps|). If the optional argument +eps+ is not given, ;TI"%it will be chosen automatically.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I")0.3.rationalize #=> (3/10)
;TI".1.333.rationalize #=> (1333/1000)
;TI"(1.333.rationalize(0.01) #=> (4/3)
;T:@format0o;
; [I"See also Float#to_r.;T:
@fileI"rational.c;T:0@omit_headings_from_table_of_contents_below0I"*flt.rationalize([eps]) -> rational
;T0[ I"(*args);T@FI"
Float;TcRDoc::NormalClass00 angle-i.ri 0000644 00000000500 15237337534 0006423 0 ustar 00 U:RDoc::AnyMethod[iI"
angle:ETI"Float#angle;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Returns 0 if the value is positive, pi otherwise.;T:
@fileI"complex.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"
Float;TcRDoc::NormalClass0[@FI"arg;T eql%3f-i.ri 0000644 00000001470 15237337534 0006423 0 ustar 00 U:RDoc::AnyMethod[iI" eql?:ETI"Float#eql?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"JReturns +true+ if +other+ is a \Float with the same value as +self+, ;TI"+false+ otherwise:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"(2.0.eql?(2.0) # => true
;TI")2.0.eql?(1.0) # => false
;TI")2.0.eql?(1) # => false
;TI")2.0.eql?(Rational(2, 1)) # => false
;TI")2.0.eql?(Complex(2, 0)) # => false
;T:@format0o;
; [I"TFloat::NAN.eql?(Float::NAN) returns an implementation-dependent value.;T@o;
; [I"3Related: Float#== (performs type conversions).;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I""eql?(other) -> true or false
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 finite%3f-i.ri 0000644 00000001274 15237337534 0007122 0 ustar 00 U:RDoc::AnyMethod[iI"finite?:ETI"Float#finite?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"HReturns +true+ if +self+ is not +Infinity+, +-Infinity+, or +Nan+, ;TI"+false+ otherwise:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"f = 2.0 # => 2.0
;TI"f.finite? # => true
;TI" f = 1.0/0.0 # => Infinity
;TI"f.finite? # => false
;TI"!f = -1.0/0.0 # => -Infinity
;TI"f.finite? # => false
;TI"f = 0.0/0.0 # => NaN
;TI"f.finite? # => false;T:@format0:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"finite? -> true or false
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00 magnitude-i.ri 0000644 00000000344 15237337534 0007320 0 ustar 00 U:RDoc::AnyMethod[iI"magnitude:ETI"Float#magnitude;TF:privateo:RDoc::Markup::Document:@parts[ :
@fileI"numeric.rb;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"
Float;TcRDoc::NormalClass00 coerce-i.ri 0000644 00000001346 15237337534 0006606 0 ustar 00 U:RDoc::AnyMethod[iI"coerce:ETI"Float#coerce;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"HReturns a 2-element array containing +other+ converted to a \Float ;TI"and +self+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"(f = 3.14 # => 3.14
;TI"/f.coerce(2) # => [2.0, 3.14]
;TI"/f.coerce(2.0) # => [2.0, 3.14]
;TI"/f.coerce(Rational(1, 2)) # => [0.5, 3.14]
;TI"/f.coerce(Complex(1, 0)) # => [1.0, 3.14]
;T:@format0o;
; [I"4Raises an exception if a type conversion fails.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"coerce(other) -> array
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 to_i-i.ri 0000644 00000001237 15237337534 0006277 0 ustar 00 U:RDoc::AnyMethod[iI" to_i:ETI"Float#to_i;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I",Returns +self+ truncated to an Integer.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"1.2.to_i # => 1
;TI"(-1.2).to_i # => -1
;T:@format0o;
; [I"BNote that the limited precision of floating-point arithmetic ;TI"$may lead to surprising results:;T@o;; [I""(0.3 / 0.1).to_i # => 2 (!)
;T;
0o;
; [I"-Float#to_int is an alias for Float#to_i.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"to_i -> integer
;T0[[I"to_int;T@ I"();T@FI"
Float;TcRDoc::NormalClass00 %2a-i.ri 0000644 00000001102 15237337534 0005703 0 ustar 00 U:RDoc::AnyMethod[iI"*:ETI"Float#*;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"EReturns a new \Float which is the product of +self+ and +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"f = 3.14
;TI""f * 2 # => 6.28
;TI""f * 2.0 # => 6.28
;TI""f * Rational(1, 2) # => 1.57
;TI"(f * Complex(2, 0) # => (6.28+0.0i);T:@format0:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"self * other -> numeric
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 nan%3f-i.ri 0000644 00000001006 15237337534 0006411 0 ustar 00 U:RDoc::AnyMethod[iI" nan?:ETI"Float#nan?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I":Returns +true+ if +self+ is a NaN, +false+ otherwise.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"f = -1.0 #=> -1.0
;TI"f.nan? #=> false
;TI"f = 0.0/0.0 #=> NaN
;TI"f.nan? #=> true;T:@format0:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"nan? -> true or false
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00 to_d-i.ri 0000644 00000001444 15237337534 0006272 0 ustar 00 U:RDoc::AnyMethod[iI" to_d:ETI"Float#to_d;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"3Returns the value of +float+ as a BigDecimal. ;TI"BThe +precision+ parameter is used to determine the number of ;TI"Csignificant digits for the result (the default is Float::DIG).;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"require 'bigdecimal'
;TI"require 'bigdecimal/util'
;TI"
;TI"!0.5.to_d # => 0.5e0
;TI""1.234.to_d(2) # => 0.12e1
;T:@format0o;
; [I"See also BigDecimal::new.;T:
@fileI"*ext/bigdecimal/lib/bigdecimal/util.rb;T:0@omit_headings_from_table_of_contents_below0I"Ofloat.to_d -> bigdecimal
float.to_d(precision) -> bigdecimal
;T0[ I"(precision=0);T@FI"
Float;TcRDoc::NormalClass00 %3c%3d-i.ri 0000644 00000001312 15237337534 0006205 0 ustar 00 U:RDoc::AnyMethod[iI"<=:ETI"
Float#<=;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"KReturns +true+ if +self+ is numerically less than or equal to +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"%2.0 <= 3 # => true
;TI"%2.0 <= 3.0 # => true
;TI"%2.0 <= Rational(3, 1) # => true
;TI"%2.0 <= 2.0 # => true
;TI"&2.0 <= 1.0 # => false
;T:@format0o;
; [I"QFloat::NAN <= Float::NAN returns an implementation-dependent value.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"$self <= other -> true or false
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 infinite%3f-i.ri 0000644 00000001557 15237337534 0007455 0 ustar 00 U:RDoc::AnyMethod[iI"infinite?:ETI"Float#infinite?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"
Returns:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o;
; [I"'1, if +self+ is Infinity.;To;;0; [o;
; [I"(-1 if +self+ is -Infinity.;To;;0; [o;
; [I"+nil+, otherwise.;T@o;
; [I"Examples:;T@o:RDoc::Markup::Verbatim; [
I" f = 1.0/0.0 # => Infinity
;TI"f.infinite? # => 1
;TI"!f = -1.0/0.0 # => -Infinity
;TI"f.infinite? # => -1
;TI"f = 1.0 # => 1.0
;TI"f.infinite? # => nil
;TI"f = 0.0/0.0 # => NaN
;TI"f.infinite? # => nil;T:@format0:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I" infinite? -> -1, 1, or nil
;T0[ I"();T@-FI"
Float;TcRDoc::NormalClass00 cdesc-Float.ri 0000644 00000022751 15237337534 0007247 0 ustar 00 U:RDoc::NormalClass[iI"
Float:ET@I"Numeric;To:RDoc::Markup::Document:@parts[o;;[ :
@fileI"*ext/bigdecimal/lib/bigdecimal/util.rb;T:0@omit_headings_from_table_of_contents_below0o;;[!o:RDoc::Markup::Paragraph;[I"QA \Float object represents a sometimes-inexact real number using the native ;TI"Carchitecture's double-precision floating point representation.;To:RDoc::Markup::BlankLine o;;[I"IFloating point has a different arithmetic and is an inexact number. ;TI";So you should know its esoteric system. See following:;T@o:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o;;[I"Dhttps://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html;To;;0;[o;;[I"Shttps://github.com/rdp/ruby_tutorials_core/wiki/Ruby-Talk-FAQ#floats_imprecise;To;;0;[o;;[I"Chttps://en.wikipedia.org/wiki/Floating_point#Accuracy_problems;T@o;;[I"4You can create a \Float object explicitly with:;T@o;
;;;[o;;0;[o;;[I"TA {floating-point literal}[doc/syntax/literals_rdoc.html#label-Float+Literals].;T@o;;[I"4You can convert certain objects to Floats with:;T@o;
;;;[o;;0;[o;;[I"1\Method {Float}[Kernel.html#method-i-Float].;T@S:RDoc::Markup::Heading:
leveli: textI"What's Here;T@o;;[I",First, what's elsewhere. \Class \Float:;T@o;
;;;[o;;0;[o;;[I"SInherits from {class Numeric}[Numeric.html#class-Numeric-label-What-27s+Here].;T@o;;[I"-Here, class \Float provides methods for:;T@o;
;;;[o;;0;[o;;[I",{Querying}[#class-Float-label-Querying];To;;0;[o;;[I".{Comparing}[#class-Float-label-Comparing];To;;0;[o;;[I"0{Converting}[#class-Float-label-Converting];T@S;;i;I"
Querying;T@o;
;;;[ o;;0;[o;
;: NOTE;[o;;[I"
#finite?;T;[o;;[I"&Returns whether +self+ is finite.;To;;0;[o;
;;;[o;;[I"
#hash;T;[o;;[I".Returns the integer hash code for +self+.;To;;0;[o;
;;;[o;;[I"#infinite?;T;[o;;[I"(Returns whether +self+ is infinite.;To;;0;[o;
;;;[o;;[I"
#nan?;T;[o;;[I"4Returns whether +self+ is a NaN (not-a-number).;T@S;;i;I"Comparing;T@o;
;;;[o;;0;[o;
;;;[o;;[I"{<}[#method-i-3C];T;[o;;[I"9Returns whether +self+ is less than the given value.;To;;0;[o;
;;;[o;;[I"{<=}[#method-i-3C-3D];T;[o;;[I")Returns whether +self+ is less than ;TI"!or equal to the given value.;To;;0;[o;
;;;[o;;[I"{<=>}[#method-i-3C-3D-3E];T;[o;;[I">Returns a number indicating whether +self+ is less than, ;TI"/equal to, or greater than the given value.;To;;0;[o;
;;;[o;;[I"6{==}[#method-i-3D-3D] (aliased as #=== and #eql>);T;[o;;[I"Returns whether +self+ is ;TI"equal to the given value.;To;;0;[o;
;;;[o;;[I"{>}[#method-i-3E];T;[o;;[I"=}[#method-i-3E-3D];T;[o;;[I",Returns whether +self+ is greater than ;TI"!or equal to the given value.;T@S;;i;I"Converting;T@o;
;;;[o;;0;[o;
;;;[o;;[I"#% (aliased as #modulo);T;[o;;[I"+Returns +self+ modulo the given value.;To;;0;[o;
;;;[o;;[I"#*;T;[o;;[I"7Returns the product of +self+ and the given value.;To;;0;[o;
;;;[o;;[I"{**}[#method-i-2A-2A];T;[o;;[I"HReturns the value of +self+ raised to the power of the given value.;To;;0;[o;
;;;[o;;[I"#+;T;[o;;[I"3Returns the sum of +self+ and the given value.;To;;0;[o;
;;;[o;;[I"#-;T;[o;;[I":Returns the difference of +self+ and the given value.;To;;0;[o;
;;;[o;;[I"{/}[#method-i-2F];T;[o;;[I"8Returns the quotient of +self+ and the given value.;To;;0;[o;
;;;[o;;[I"
#ceil;T;[o;;[I"AReturns the smallest number greater than or equal to +self+.;To;;0;[o;
;;;[o;;[I"#coerce;T;[o;;[I"PReturns a 2-element array containing the given value converted to a \Float ;TI"and +self+;To;;0;[o;
;;;[o;;[I"#divmod;T;[o;;[I"EReturns a 2-element array containing the quotient and remainder ;TI"3results of dividing +self+ by the given value.;To;;0;[o;
;;;[o;;[I"
#fdiv;T;[o;;[I"DReturns the Float result of dividing +self+ by the given value.;To;;0;[o;
;;;[o;;[I"#floor;T;[o;;[I"AReturns the greatest number smaller than or equal to +self+.;To;;0;[o;
;;;[o;;[I"#next_float;T;[o;;[I"2Returns the next-larger representable \Float.;To;;0;[o;
;;;[o;;[I"#prev_float;T;[o;;[I"3Returns the next-smaller representable \Float.;To;;0;[o;
;;;[o;;[I" #quo;T;[o;;[I"BReturns the quotient from dividing +self+ by the given value.;To;;0;[o;
;;;[o;;[I"#round;T;[o;;[I"GReturns +self+ rounded to the nearest value, to a given precision.;To;;0;[o;
;;;[o;;[I"#to_i (aliased as #to_int);T;[o;;[I",Returns +self+ truncated to an Integer.;To;;0;[o;
;;;[o;;[I" #to_s (aliased as #inspect);T;[o;;[I"1Returns a string containing the place-value ;TI"1representation of +self+ in the given radix.;To;;0;[o;
;;;[o;;[I"#truncate;T;[o;;[I"3Returns +self+ truncated to a given precision.;T; I"numeric.c;T;
0o;;[ ; I"numeric.rb;T;
0; 0;
0[ [U:RDoc::Constant[i I"
RADIX;TI"Float::RADIX;T:public0o;;[o;;[I"HThe base of the floating point, or number of unique digits used to ;TI"represent the number.;T@o;;[I"TUsually defaults to 2 on most systems, which would represent a base-10 decimal.;T; @ ;
0@ @cRDoc::NormalClass0U;[i I"
MANT_DIG;TI"Float::MANT_DIG;T;0o;;[o;;[I":The number of base digits for the +double+ data type.;T@o;;[I"Usually defaults to 53.;T; @ ;
0@ @@³0U;[i I"DIG;TI"Float::DIG;T;0o;;[o;;[I"LThe minimum number of significant decimal digits in a double-precision ;TI"floating point.;T@o;;[I"Usually defaults to 15.;T; @ ;
0@ @@³0U;[i I"MIN_EXP;TI"Float::MIN_EXP;T;0o;;[o;;[I"IThe smallest possible exponent value in a double-precision floating ;TI"point.;T@o;;[I"Usually defaults to -1021.;T; @ ;
0@ @@³0U;[i I"MAX_EXP;TI"Float::MAX_EXP;T;0o;;[o;;[I"HThe largest possible exponent value in a double-precision floating ;TI"point.;T@o;;[I"Usually defaults to 1024.;T; @ ;
0@ @@³0U;[i I"MIN_10_EXP;TI"Float::MIN_10_EXP;T;0o;;[o;;[I"IThe smallest negative exponent in a double-precision floating point ;TI"+where 10 raised to this power minus 1.;T@o;;[I"Usually defaults to -307.;T; @ ;
0@ @@³0U;[i I"MAX_10_EXP;TI"Float::MAX_10_EXP;T;0o;;[o;;[I"NThe largest positive exponent in a double-precision floating point where ;TI"%10 raised to this power minus 1.;T@o;;[I"Usually defaults to 308.;T; @ ;
0@ @@³0U;[i I"MIN;TI"Float::MIN;T;0o;;[
o;;[I"RThe smallest positive normalized number in a double-precision floating point.;T@o;;[I"1Usually defaults to 2.2250738585072014e-308.;T@o;;[ I"4If the platform supports denormalized numbers, ;TI"4there are numbers between zero and Float::MIN. ;TI"H0.0.next_float returns the smallest positive floating point number ;TI"$including denormalized numbers.;T; @ ;
0@ @@³0U;[i I"MAX;TI"Float::MAX;T;0o;;[o;;[I"NThe largest possible integer in a double-precision floating point number.;T@o;;[I"1Usually defaults to 1.7976931348623157e+308.;T; @ ;
0@ @@³0U;[i I"EPSILON;TI"Float::EPSILON;T;0o;;[o;;[I"IThe difference between 1 and the smallest double-precision floating ;TI"!point number greater than 1.;T@o;;[I"0Usually defaults to 2.2204460492503131e-16.;T; @ ;
0@ @@³0U;[i I"
INFINITY;TI"Float::INFINITY;T;0o;;[o;;[I"2An expression representing positive infinity.;T; @ ;
0@ @@³0U;[i I"NAN;TI"Float::NAN;T;0o;;[o;;[I"@An expression representing a value which is "not a number".;T; @ ;
0@ @@³0[ [[I"
class;T[[;[ [:protected[ [:private[ [I"
instance;T[[;[ [;[ [;[5[I"%;TI"numeric.c;T[I"*;T@T[I"**;T@T[I"+;T@T[I"-;T@T[I"-@;TI"numeric.rb;T[I"/;T@T[I"<;T@T[I"<=;T@T[I"<=>;T@T[I"==;T@T[I"===;T@T[I">;T@T[I">=;T@T[I"abs;T@_[I"
angle;TI"complex.c;T[I"arg;T@t[I" ceil;T@T[I"coerce;T@T[I"denominator;TI"rational.c;T[I"divmod;T@T[I" eql?;T@T[I" fdiv;T@T[I"finite?;T@T[I"
floor;T@T[I" hash;T@T[I"infinite?;T@T[I"inspect;T@T[I"magnitude;T@_[I"modulo;T@T[I" nan?;T@T[I"negative?;T@_[I"next_float;T@T[I"numerator;T@}[I"
phase;T@t[I"positive?;T@_[I"prev_float;T@T[I"quo;T@T[I"rationalize;T@}[I"
round;T@T[I" to_d;TI"*ext/bigdecimal/lib/bigdecimal/util.rb;T[I" to_f;T@_[I" to_i;T@T[I"to_int;T@T[I" to_r;T@}[I" to_s;T@T[I"
truncate;T@T[I"
zero?;T@_[ [U:RDoc::Context::Section[i 0o;;[ ; 0;
0[
I"complex.c;TI"*ext/bigdecimal/lib/bigdecimal/util.rb;TI"ext/date/lib/date.rb;TI"*ext/psych/lib/psych/scalar_scanner.rb;TI"lib/reline/line_editor.rb;TI"numeric.c;TI"numeric.rb;TI"rational.c;T@£cRDoc::TopLevel %3e%3d-i.ri 0000644 00000001315 15237337534 0006212 0 ustar 00 U:RDoc::AnyMethod[iI">=:ETI"
Float#>=;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"NReturns +true+ if +self+ is numerically greater than or equal to +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"%2.0 >= 1 # => true
;TI"%2.0 >= 1.0 # => true
;TI"%2.0 >= Rational(1, 2) # => true
;TI"%2.0 >= 2.0 # => true
;TI"&2.0 >= 2.1 # => false
;T:@format0o;
; [I"QFloat::NAN >= Float::NAN returns an implementation-dependent value.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"$self >= other -> true or false
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 truncate-i.ri 0000644 00000002425 15237337534 0007172 0 ustar 00 U:RDoc::AnyMethod[iI"
truncate:ETI"Float#truncate;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"/Returns +self+ truncated (toward zero) to ;TI"-a precision of +ndigits+ decimal digits.;To:RDoc::Markup::BlankLine o;
; [I"GWhen +ndigits+ is positive, returns a float with +ndigits+ digits ;TI",after the decimal point (as available):;T@o:RDoc::Markup::Verbatim; [I"f = 12345.6789
;TI" f.truncate(1) # => 12345.6
;TI""f.truncate(3) # => 12345.678
;TI"f = -12345.6789
;TI"!f.truncate(1) # => -12345.6
;TI"#f.truncate(3) # => -12345.678
;T:@format0o;
; [I"4When +ndigits+ is negative, returns an integer ;TI"7with at least ndigits.abs trailing zeros:;T@o;; [I"f = 12345.6789
;TI"f.truncate(0) # => 12345
;TI"f.truncate(-3) # => 12000
;TI"f = -12345.6789
;TI" f.truncate(0) # => -12345
;TI" f.truncate(-3) # => -12000
;T;
0o;
; [I"BNote that the limited precision of floating-point arithmetic ;TI"$may lead to surprising results:;T@o;; [I"%(0.3 / 0.1).truncate #=> 2 (!)
;T;
0o;
; [I"Related: Float#round.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"/truncate(ndigits = 0) -> float or integer
;T0[ I"(*args);T@2FI"
Float;TcRDoc::NormalClass00 %3e-i.ri 0000644 00000001222 15237337534 0005713 0 ustar 00 U:RDoc::AnyMethod[iI">:ETI"Float#>;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"BReturns +true+ if +self+ is numerically greater than +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"$2.0 > 1 # => true
;TI"$2.0 > 1.0 # => true
;TI"$2.0 > Rational(1, 2) # => true
;TI"%2.0 > 2.0 # => false
;T:@format0o;
; [I"PFloat::NAN > Float::NAN returns an implementation-dependent value.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"#self > other -> true or false
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 next_float-i.ri 0000644 00000004024 15237337534 0007505 0 ustar 00 U:RDoc::AnyMethod[iI"next_float:ETI"Float#next_float;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"2Returns the next-larger representable \Float.;To:RDoc::Markup::BlankLine o;
; [I"KThese examples show the internally stored values (64-bit hexadecimal) ;TI"Ifor each \Float +f+ and for the corresponding f.next_float:;T@o:RDoc::Markup::Verbatim; [
I"'f = 0.0 # 0x0000000000000000
;TI"'f.next_float # 0x0000000000000001
;TI"
;TI"'f = 0.01 # 0x3f847ae147ae147b
;TI"'f.next_float # 0x3f847ae147ae147c
;T:@format0o;
; [I"JIn the remaining examples here, the output is shown in the usual way ;TI"(result +to_s+):;T@o;; [I"20.01.next_float # => 0.010000000000000002
;TI"01.0.next_float # => 1.0000000000000002
;TI"0100.0.next_float # => 100.00000000000001
;TI"
;TI"f = 0.01
;TI"[(0..3).each_with_index {|i| printf "%2d %-20a %s\n", i, f, f.to_s; f = f.next_float }
;T;
0o;
; [I"Output:;T@o;; [I"" 0 0x1.47ae147ae147bp-7 0.01
;TI"2 1 0x1.47ae147ae147cp-7 0.010000000000000002
;TI"2 2 0x1.47ae147ae147dp-7 0.010000000000000004
;TI"2 3 0x1.47ae147ae147ep-7 0.010000000000000005
;TI"
;TI"%f = 0.0; 100.times { f += 0.1 }
;TI"bf # => 9.99999999999998 # should be 10.0 in the ideal world.
;TI"Y10-f # => 1.9539925233402755e-14 # the floating point error.
;TI"_10.0.next_float-10 # => 1.7763568394002505e-15 # 1 ulp (unit in the last place).
;TI"T(10-f)/(10.0.next_float-10) # => 11.0 # the error is 11 ulp.
;TI"[(10-f)/(10*Float::EPSILON) # => 8.8 # approximation of the above.
;TI"1"%a" % 10 # => "0x1.4p+3"
;TI"j"%a" % f # => "0x1.3fffffffffff5p+3" # the last hex digit is 5. 16 - 5 = 11 ulp.
;T;
0o;
; [I"Related: Float#prev_float;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"next_float -> float
;T0[ I"();T@;FI"
Float;TcRDoc::NormalClass00 %2a%2a-i.ri 0000644 00000001164 15237337534 0006203 0 ustar 00 U:RDoc::AnyMethod[iI"**:ETI"
Float#**;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"+Raises +self+ to the power of +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"f = 3.14
;TI"%f ** 2 # => 9.8596
;TI"1f ** -2 # => 0.1014239928597509
;TI"1f ** 2.1 # => 11.054834900588839
;TI"%f ** Rational(2, 1) # => 9.8596
;TI")f ** Complex(2, 0) # => (9.8596+0i);T:@format0:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"self ** other -> numeric
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 %2f-i.ri 0000644 00000001111 15237337534 0005710 0 ustar 00 U:RDoc::AnyMethod[iI"/:ETI"Float#/;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"LReturns a new \Float which is the result of dividing +self+ by +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"f = 3.14
;TI""f / 2 # => 1.57
;TI""f / 2.0 # => 1.57
;TI""f / Rational(2, 1) # => 1.57
;TI"(f / Complex(2, 0) # => (1.57+0.0i);T:@format0:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"self / other -> numeric
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 to_s-i.ri 0000644 00000001776 15237337534 0006321 0 ustar 00 U:RDoc::AnyMethod[iI" to_s:ETI"Float#to_s;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"=Returns a string containing a representation of +self+; ;TI"Adepending of the value of +self+, the string representation ;TI"may contain:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List:
@type:BULLET:@items[
o:RDoc::Markup::ListItem:@label0; [o;
; [I"A fixed-point number.;To;;0; [o;
; [I"@A number in "scientific notation" (containing an exponent).;To;;0; [o;
; [I"'Infinity'.;To;;0; [o;
; [I"'-Infinity'.;To;;0; [o;
; [I"%'NaN' (indicating not-a-number).;T@o;
; [
I"#3.14.to_s # => "3.14" ;TI"4(10.1**50).to_s # => "1.644631821843879e+50" ;TI"'(10.1**500).to_s # => "Infinity" ;TI"((-10.1**500).to_s # => "-Infinity" ;TI"!(0.0/0.0).to_s # => "NaN";T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"to_s -> string
;T0[[I"inspect;T@ I"();T@3FI"
Float;TcRDoc::NormalClass00 to_int-i.ri 0000644 00000001213 15237337534 0006633 0 ustar 00 U:RDoc::AnyMethod[iI"to_int:ETI"Float#to_int;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I",Returns +self+ truncated to an Integer.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"1.2.to_i # => 1
;TI"(-1.2).to_i # => -1
;T:@format0o;
; [I"BNote that the limited precision of floating-point arithmetic ;TI"$may lead to surprising results:;T@o;; [I""(0.3 / 0.1).to_i # => 2 (!)
;T;
0o;
; [I"-Float#to_int is an alias for Float#to_i.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"
Float;TcRDoc::NormalClass0[@ FI" to_i;T numerator-i.ri 0000644 00000001127 15237337534 0007357 0 ustar 00 U:RDoc::AnyMethod[iI"numerator:ETI"Float#numerator;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"=Returns the numerator. The result is machine dependent.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"/n = 0.3.numerator #=> 5404319552844595
;TI"0d = 0.3.denominator #=> 18014398509481984
;TI""n.fdiv(d) #=> 0.3
;T:@format0o;
; [I" See also Float#denominator.;T:
@fileI"rational.c;T:0@omit_headings_from_table_of_contents_below0I" flo.numerator -> integer
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00 %3c-i.ri 0000644 00000001217 15237337534 0005715 0 ustar 00 U:RDoc::AnyMethod[iI"<:ETI"Float#<;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"?Returns +true+ if +self+ is numerically less than +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"$2.0 < 3 # => true
;TI"$2.0 < 3.0 # => true
;TI"$2.0 < Rational(3, 1) # => true
;TI"%2.0 < 2.0 # => false
;T:@format0o;
; [I"PFloat::NAN < Float::NAN returns an implementation-dependent value.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"#self < other -> true or false
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 divmod-i.ri 0000644 00000002030 15237337534 0006617 0 ustar 00 U:RDoc::AnyMethod[iI"divmod:ETI"Float#divmod;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"5Returns a 2-element array [q, r], where;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I",q = (self/other).floor # Quotient
;TI"-r = self % other # Remainder
;T:@format0o;
; [I"Examples:;T@o;; [I"/11.0.divmod(4) # => [2, 3.0]
;TI"111.0.divmod(-4) # => [-3, -1.0]
;TI"0-11.0.divmod(4) # => [-3, 1.0]
;TI"0-11.0.divmod(-4) # => [2, -3.0]
;TI"
;TI"/12.0.divmod(4) # => [3, 0.0]
;TI"012.0.divmod(-4) # => [-3, 0.0]
;TI"1-12.0.divmod(4) # => [-3, -0.0]
;TI"0-12.0.divmod(-4) # => [3, -0.0]
;TI"
;TI"/13.0.divmod(4.0) # => [3, 1.0]
;TI".13.0.divmod(Rational(4, 1)) # => [3, 1.0];T;
0:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"divmod(other) -> array
;T0[ I" (p1);T@$FI"
Float;TcRDoc::NormalClass00 to_f-i.ri 0000644 00000000514 15237337534 0006271 0 ustar 00 U:RDoc::AnyMethod[iI" to_f:ETI"Float#to_f;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Since +float+ is already a Float, returns +self+.;T:
@fileI"numeric.rb;T:0@omit_headings_from_table_of_contents_below0I"float.to_f -> self
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00 modulo-i.ri 0000644 00000001713 15237337534 0006643 0 ustar 00 U:RDoc::AnyMethod[iI"modulo:ETI"Float#modulo;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I".Returns +self+ modulo +other+ as a float.;To:RDoc::Markup::BlankLine o;
; [I"IFor float +f+ and real number +r+, these expressions are equivalent:;T@o:RDoc::Markup::Verbatim; [I"f % r
;TI"f-r*(f/r).floor
;TI"f.divmod(r)[1]
;T:@format0o;
; [I"See Numeric#divmod.;T@o;
; [I"Examples:;T@o;; [I"$10.0 % 2 # => 0.0
;TI"$10.0 % 3 # => 1.0
;TI"$10.0 % 4 # => 2.0
;TI"
;TI"$10.0 % -2 # => 0.0
;TI"%10.0 % -3 # => -2.0
;TI"%10.0 % -4 # => -2.0
;TI"
;TI"$10.0 % 4.0 # => 2.0
;TI"$10.0 % Rational(4, 1) # => 2.0
;T;
0o;
; [I"*Float#modulo is an alias for Float#%.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below000[ I" (p1);T@,FI"
Float;TcRDoc::NormalClass0[@/FI"%;T positive%3f-i.ri 0000644 00000000537 15237337534 0007507 0 ustar 00 U:RDoc::AnyMethod[iI"positive?:ETI"Float#positive?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"1Returns +true+ if +float+ is greater than 0.;T:
@fileI"numeric.rb;T:0@omit_headings_from_table_of_contents_below0I"(float.positive? -> true or false
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00 %3d%3d%3d-i.ri 0000644 00000001327 15237337534 0006510 0 ustar 00 U:RDoc::AnyMethod[iI"===:ETI"Float#===;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"OReturns +true+ if +other+ has the same value as +self+, +false+ otherwise:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"%2.0 == 2 # => true
;TI"%2.0 == 2.0 # => true
;TI"%2.0 == Rational(2, 1) # => true
;TI"%2.0 == Complex(2, 0) # => true
;T:@format0o;
; [I"QFloat::NAN == Float::NAN returns an implementation-dependent value.;T@o;
; [I";Related: Float#eql? (requires +other+ to be a \Float).;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below000[ I" (p1);T@FI"
Float;TcRDoc::NormalClass0[@FI"==;T %2d%40-i.ri 0000644 00000000455 15237337534 0006131 0 ustar 00 U:RDoc::AnyMethod[iI"-@:ETI"
Float#-@;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Returns +float+, negated.;T:
@fileI"numeric.rb;T:0@omit_headings_from_table_of_contents_below0I"-float -> float
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00 ceil-i.ri 0000644 00000002404 15237337534 0006256 0 ustar 00 U:RDoc::AnyMethod[iI" ceil:ETI"Float#ceil;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FReturns the smallest number greater than or equal to +self+ with ;TI"-a precision of +ndigits+ decimal digits.;To:RDoc::Markup::BlankLine o;
; [I"@When +ndigits+ is positive, returns a float with +ndigits+ ;TI"3digits after the decimal point (as available):;T@o:RDoc::Markup::Verbatim; [I"f = 12345.6789
;TI"f.ceil(1) # => 12345.7
;TI"f.ceil(3) # => 12345.679
;TI"f = -12345.6789
;TI"f.ceil(1) # => -12345.6
;TI"f.ceil(3) # => -12345.678
;T:@format0o;
; [I"FWhen +ndigits+ is non-positive, returns an integer with at least ;TI"-ndigits.abs trailing zeros:;T@o;; [I"f = 12345.6789
;TI"f.ceil(0) # => 12346
;TI"f.ceil(-3) # => 13000
;TI"f = -12345.6789
;TI"f.ceil(0) # => -12345
;TI"f.ceil(-3) # => -12000
;T;
0o;
; [I"BNote that the limited precision of floating-point arithmetic ;TI"$may lead to surprising results:;T@o;; [I"!(2.1 / 0.7).ceil #=> 4 (!)
;T;
0o;
; [I"Related: Float#floor.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"+ceil(ndigits = 0) -> float or integer
;T0[ I"(*args);T@2FI"
Float;TcRDoc::NormalClass00 %2b-i.ri 0000644 00000001174 15237337534 0005715 0 ustar 00 U:RDoc::AnyMethod[iI"+:ETI"Float#+;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"AReturns a new \Float which is the sum of +self+ and +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"f = 3.14
;TI"2f + 1 # => 4.140000000000001
;TI"2f + 1.0 # => 4.140000000000001
;TI"2f + Rational(1, 1) # => 4.140000000000001
;TI"6f + Complex(1, 0) # => (4.140000000000001+0i);T:@format0:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"self + other -> numeric
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 quo-i.ri 0000644 00000001212 15237337534 0006142 0 ustar 00 U:RDoc::AnyMethod[iI"quo:ETI"Float#quo;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I":Returns the quotient from dividing +self+ by +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"f = 3.14
;TI"%f.quo(2) # => 1.57
;TI"&f.quo(-2) # => -1.57
;TI"%f.quo(Rational(2, 1)) # => 1.57
;TI",f.quo(Complex(2, 0)) # => (1.57+0.0i)
;T:@format0o;
; [I"*Float#fdiv is an alias for Float#quo.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"quo(other) -> numeric
;T0[[I" fdiv;T@ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 negative%3f-i.ri 0000644 00000000534 15237337534 0007444 0 ustar 00 U:RDoc::AnyMethod[iI"negative?:ETI"Float#negative?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I".Returns +true+ if +float+ is less than 0.;T:
@fileI"numeric.rb;T:0@omit_headings_from_table_of_contents_below0I"(float.negative? -> true or false
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00 abs-i.ri 0000644 00000001074 15237337534 0006111 0 ustar 00 U:RDoc::AnyMethod[iI"abs:ETI"Float#abs;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"+Returns the absolute value of +float+.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"(-34.56).abs #=> 34.56
;TI"-34.56.abs #=> 34.56
;TI"34.56.abs #=> 34.56
;T:@format0o;
; [I"/Float#magnitude is an alias for Float#abs.;T:
@fileI"numeric.rb;T:0@omit_headings_from_table_of_contents_below0I";float.abs -> float
float.magnitude -> float
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00 %2d-i.ri 0000644 00000001117 15237337534 0005714 0 ustar 00 U:RDoc::AnyMethod[iI"-:ETI"Float#-;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"HReturns a new \Float which is the difference of +self+ and +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"f = 3.14
;TI"%f - 1 # => 2.14
;TI"%f - 1.0 # => 2.14
;TI"%f - Rational(1, 1) # => 2.14
;TI")f - Complex(1, 0) # => (2.14+0i);T:@format0:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"self - other -> numeric
;T0[ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 floor-i.ri 0000644 00000002413 15237337534 0006463 0 ustar 00 U:RDoc::AnyMethod[iI"
floor:ETI"Float#floor;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"BReturns the largest number less than or equal to +self+ with ;TI"-a precision of +ndigits+ decimal digits.;To:RDoc::Markup::BlankLine o;
; [I"@When +ndigits+ is positive, returns a float with +ndigits+ ;TI"3digits after the decimal point (as available):;T@o:RDoc::Markup::Verbatim; [I"f = 12345.6789
;TI"f.floor(1) # => 12345.6
;TI"f.floor(3) # => 12345.678
;TI"f = -12345.6789
;TI"f.floor(1) # => -12345.7
;TI" f.floor(3) # => -12345.679
;T:@format0o;
; [I"FWhen +ndigits+ is non-positive, returns an integer with at least ;TI"-ndigits.abs trailing zeros:;T@o;; [I"f = 12345.6789
;TI"f.floor(0) # => 12345
;TI"f.floor(-3) # => 12000
;TI"f = -12345.6789
;TI"f.floor(0) # => -12346
;TI"f.floor(-3) # => -13000
;T;
0o;
; [I"BNote that the limited precision of floating-point arithmetic ;TI"$may lead to surprising results:;T@o;; [I""(0.3 / 0.1).floor #=> 2 (!)
;T;
0o;
; [I"Related: Float#ceil.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I",floor(ndigits = 0) -> float or integer
;T0[ I"(*args);T@2FI"
Float;TcRDoc::NormalClass00 %3d%3d-i.ri 0000644 00000001373 15237337534 0006215 0 ustar 00 U:RDoc::AnyMethod[iI"==:ETI"
Float#==;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"OReturns +true+ if +other+ has the same value as +self+, +false+ otherwise:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"%2.0 == 2 # => true
;TI"%2.0 == 2.0 # => true
;TI"%2.0 == Rational(2, 1) # => true
;TI"%2.0 == Complex(2, 0) # => true
;T:@format0o;
; [I"QFloat::NAN == Float::NAN returns an implementation-dependent value.;T@o;
; [I";Related: Float#eql? (requires +other+ to be a \Float).;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"$self == other -> true or false
;T0[[I"===;T@ I" (p1);T@FI"
Float;TcRDoc::NormalClass00 zero%3f-i.ri 0000644 00000000510 15237337534 0006613 0 ustar 00 U:RDoc::AnyMethod[iI"
zero?:ETI"Float#zero?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"&Returns +true+ if +float+ is 0.0.;T:
@fileI"numeric.rb;T:0@omit_headings_from_table_of_contents_below0I"$float.zero? -> true or false
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00 %3c%3d%3e-i.ri 0000644 00000002324 15237337534 0006506 0 ustar 00 U:RDoc::AnyMethod[iI"<=>:ETI"Float#<=>;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I":Returns a value that depends on the numeric relation ;TI" between +self+ and +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List:
@type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o;
; [I"(-1, if +self+ is less than +other+.;To;;0; [o;
; [I"&0, if +self+ is equal to +other+.;To;;0; [o;
; [I"*1, if +self+ is greater than +other+.;To;;0; [o;
; [I"1+nil+, if the two values are incommensurate.;T@o;
; [I"Examples:;T@o:RDoc::Markup::Verbatim; [I"#2.0 <=> 2 # => 0
;TI"#2.0 <=> 2.0 # => 0
;TI"#2.0 <=> Rational(2, 1) # => 0
;TI"#2.0 <=> Complex(2, 0) # => 0
;TI"#2.0 <=> 1.9 # => 1
;TI"$2.0 <=> 2.1 # => -1
;TI"%2.0 <=> 'foo' # => nil
;T:@format0o;
; [I">This is the basis for the tests in the Comparable module.;T@o;
; [I"RFloat::NAN <=> Float::NAN returns an implementation-dependent value.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"*self <=> other -> -1, 0, +1, or nil
;T0[ I" (p1);T@8FI"
Float;TcRDoc::NormalClass00 denominator-i.ri 0000644 00000000707 15237337534 0007665 0 ustar 00 U:RDoc::AnyMethod[iI"denominator:ETI"Float#denominator;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"GReturns the denominator (always positive). The result is machine ;TI"dependent.;To:RDoc::Markup::BlankLine o;
; [I"See also Float#numerator.;T:
@fileI"rational.c;T:0@omit_headings_from_table_of_contents_below0I""flo.denominator -> integer
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00 hash-i.ri 0000644 00000000576 15237337534 0006275 0 ustar 00 U:RDoc::AnyMethod[iI" hash:ETI"Float#hash;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"/Returns the integer hash value for +self+.;To:RDoc::Markup::BlankLine o;
; [I"See also Object#hash.;T:
@fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"hash -> integer
;T0[ I"();T@FI"
Float;TcRDoc::NormalClass00