ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- %25-i.ri000064400000001742152373375340005641 0ustar00U: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::BlankLineo; ; [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::NormalClass00to_r-i.ri000064400000001470152373375340006307 0ustar00U: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::BlankLineo: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::NormalClass00phase-i.ri000064400000000500152373375340006435 0ustar00U: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;Tround-i.ri000064400000004026152373375340006473 0ustar00U: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::BlankLineo; ; [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::NormalClass00inspect-i.ri000064400000001754152373375340007016 0ustar00U: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::BlankLineo: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;Tfdiv-i.ri000064400000001157152373375340006276 0ustar00U: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::BlankLineo: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;Tprev_float-i.ri000064400000002564152373375340007512 0ustar00U: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::BlankLineo; ; [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::NormalClass00arg-i.ri000064400000000642152373375340006115 0ustar00U: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::NormalClass00rationalize-i.ri000064400000001326152373375340007665 0ustar00U: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::BlankLineo: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::NormalClass00angle-i.ri000064400000000500152373375340006423 0ustar00U: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;Teql%3f-i.ri000064400000001470152373375340006423 0ustar00U: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::BlankLineo: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::NormalClass00finite%3f-i.ri000064400000001274152373375340007122 0ustar00U: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::BlankLineo: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::NormalClass00magnitude-i.ri000064400000000344152373375340007320 0ustar00U: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::NormalClass00coerce-i.ri000064400000001346152373375340006606 0ustar00U: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::BlankLineo: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::NormalClass00to_i-i.ri000064400000001237152373375340006277 0ustar00U: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::BlankLineo: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.ri000064400000001102152373375340005703 0ustar00U: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::BlankLineo: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::NormalClass00nan%3f-i.ri000064400000001006152373375340006411 0ustar00U: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::BlankLineo: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::NormalClass00to_d-i.ri000064400000001444152373375340006272 0ustar00U: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::BlankLineo: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.ri000064400000001312152373375340006205 0ustar00U: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::BlankLineo: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::NormalClass00infinite%3f-i.ri000064400000001557152373375340007455 0ustar00U:RDoc::AnyMethod[iI"infinite?:ETI"Float#infinite?;TF: privateo:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I" Returns:;To:RDoc::Markup::BlankLineo: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::NormalClass00cdesc-Float.ri000064400000022751152373375340007247 0ustar00U: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::BlankLineo; ;[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[iI" 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;[iI" 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;[iI"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;[iI" 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;[iI" 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;[iI"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;[iI"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;[iI"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;[iI"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;[iI" 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;[iI" INFINITY;TI"Float::INFINITY;T;0o;;[o; ;[I"2An expression representing positive infinity.;T; @ ; 0@ @@³0U;[iI"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[i0o;;[; 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.ri000064400000001315152373375340006212 0ustar00U: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::BlankLineo: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::NormalClass00truncate-i.ri000064400000002425152373375340007172 0ustar00U: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::BlankLineo; ; [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.ri000064400000001222152373375340005713 0ustar00U: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::BlankLineo: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::NormalClass00next_float-i.ri000064400000004024152373375340007505 0ustar00U: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::BlankLineo; ; [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.ri000064400000001164152373375340006203 0ustar00U: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::BlankLineo: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.ri000064400000001111152373375340005710 0ustar00U: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::BlankLineo: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::NormalClass00to_s-i.ri000064400000001776152373375340006321 0ustar00U: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::BlankLineo: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::NormalClass00to_int-i.ri000064400000001213152373375340006633 0ustar00U: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::BlankLineo: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;Tnumerator-i.ri000064400000001127152373375340007357 0ustar00U: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::BlankLineo: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.ri000064400000001217152373375340005715 0ustar00U: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::BlankLineo: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::NormalClass00divmod-i.ri000064400000002030152373375340006617 0ustar00U: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::BlankLineo: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::NormalClass00to_f-i.ri000064400000000514152373375340006271 0ustar00U: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::NormalClass00modulo-i.ri000064400000001713152373375340006643 0ustar00U: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::BlankLineo; ; [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"%;Tpositive%3f-i.ri000064400000000537152373375340007507 0ustar00U: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.ri000064400000001327152373375340006510 0ustar00U: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::BlankLineo: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.ri000064400000000455152373375340006131 0ustar00U: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::NormalClass00ceil-i.ri000064400000002404152373375340006256 0ustar00U: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::BlankLineo; ; [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.ri000064400000001174152373375340005715 0ustar00U: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::BlankLineo: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::NormalClass00quo-i.ri000064400000001212152373375340006142 0ustar00U: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::BlankLineo: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::NormalClass00negative%3f-i.ri000064400000000534152373375340007444 0ustar00U: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::NormalClass00abs-i.ri000064400000001074152373375340006111 0ustar00U: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::BlankLineo: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.ri000064400000001117152373375340005714 0ustar00U: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::BlankLineo: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::NormalClass00floor-i.ri000064400000002413152373375340006463 0ustar00U: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::BlankLineo; ; [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.ri000064400000001373152373375340006215 0ustar00U: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::BlankLineo: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::NormalClass00zero%3f-i.ri000064400000000510152373375340006613 0ustar00U: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.ri000064400000002324152373375340006506 0ustar00U: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::BlankLineo: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::NormalClass00denominator-i.ri000064400000000707152373375340007665 0ustar00U: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::BlankLineo; ; [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::NormalClass00hash-i.ri000064400000000576152373375340006275 0ustar00U: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::BlankLineo; ; [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