ÿØÿà JFIF ÿÛ „ ( %!1!%*+...983,7(-.-
PK ]k %25-i.rinu [ U:RDoc::AnyMethod[iI"%:ETI"BigDecimal#%;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I",Returns the modulus from dividing by b.;To:RDoc::Markup::BlankLine o;
; [I"See BigDecimal#divmod.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"a % b
a.modulo(b)
;T0[[I"modulo;T@ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]Ҭ save_limit-c.rinu [ U:RDoc::AnyMethod[iI"save_limit:ETI"BigDecimal::save_limit;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"AExecute the provided block, but preserve the precision limit;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"BigDecimal.limit(100)
;TI"puts BigDecimal.limit
;TI"BigDecimal.save_limit do
;TI" BigDecimal.limit(200)
;TI" puts BigDecimal.limit
;TI" end
;TI"puts BigDecimal.limit;T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"#BigDecimal.save_limit { ... }
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]@? ? to_r-i.rinu [ U:RDoc::AnyMethod[iI" to_r:ETI"BigDecimal#to_r;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I")Converts a BigDecimal to a Rational.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]3J remainder-i.rinu [ U:RDoc::AnyMethod[iI"remainder:ETI"BigDecimal#remainder;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"6Returns the remainder from dividing by the value.;To:RDoc::Markup::BlankLine o;
; [I",x.remainder(y) means x-y*(x/y).truncate;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"remainder(value)
;T0[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]2
power-i.rinu [ U:RDoc::AnyMethod[iI"
power:ETI"BigDecimal#power;TF:privateo:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [I"0Returns the value raised to the power of n.;To:RDoc::Markup::BlankLine o;
; [I"$Note that n must be an Integer.;T@o;
; [I"'Also available as the operator **.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"power(n)
power(n, prec)
;T0[ I"(p1, p2 = v2);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]H~O- - cdesc-BigDecimal.rinu [ U:RDoc::NormalClass[iI"BigDecimal:ET@I"Numeric;To:RDoc::Markup::Document:@parts[o;;[Uo:RDoc::Markup::Paragraph;[I"OBigDecimal provides arbitrary-precision floating point decimal arithmetic.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading:
leveli: textI"Introduction;T@o; ;[I"ORuby provides built-in support for arbitrary precision integer arithmetic.;T@o; ;[I"For example:;T@o:RDoc::Markup::Verbatim;[I"*42**13 #=> 1265437718438866624512
;T:@format0o; ;[I"RBigDecimal provides similar support for very large or very accurate floating ;TI"point numbers.;T@o; ;[ I"KDecimal arithmetic is also useful for general calculation, because it ;TI"Pprovides the correct answers people expect--whereas normal binary floating ;TI"Opoint arithmetic often introduces subtle errors because of the conversion ;TI" between base 10 and base 2.;T@o; ;[I"For example, try:;T@o;;[
I"
sum = 0
;TI"10_000.times do
;TI" sum = sum + 0.0001
;TI" end
;TI"&print sum #=> 0.9999999999999062
;T;0o; ;[I"'and contrast with the output from:;T@o;;[I"require 'bigdecimal'
;TI"
;TI"sum = BigDecimal("0")
;TI"10_000.times do
;TI"( sum = sum + BigDecimal("0.0001")
;TI" end
;TI"print sum #=> 0.1E1
;T;0o; ;[I"Similarly:;T@o;;[I"K(BigDecimal("1.2") - BigDecimal("1.0")) == BigDecimal("0.2") #=> true
;TI"
;TI""(1.2 - 1.0) == 0.2 #=> false
;T;0S;;i;
I"A Note About Precision;T@o; ;[I"@For a calculation using a \BigDecimal and another +value+, ;TI"@the precision of the result depends on the type of +value+:;T@o:RDoc::Markup::List:
@type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0;[o; ;[I"If +value+ is a \Float, ;TI"%the precision is Float::DIG + 1.;To;;0;[o; ;[I"LIf +value+ is a \Rational, the precision is larger than Float::DIG + 1.;To;;0;[o; ;[I"NIf +value+ is a \BigDecimal, the precision is +value+'s precision in the ;TI":internal representation, which is platform-dependent.;To;;0;[o; ;[I"bIf +value+ is other object, the precision is determined by the result of +BigDecimal(value)+.;T@S;;i;
I"4Special features of accurate decimal arithmetic;T@o; ;[I"KBecause BigDecimal is more accurate than normal binary floating point ;TI"1arithmetic, it requires some special values.;T@S;;i;
I"
Infinity;T@o; ;[I"NBigDecimal sometimes needs to return infinity, for example if you divide ;TI"a value by zero.;T@o;;[I"9BigDecimal("1.0") / BigDecimal("0.0") #=> Infinity
;TI";BigDecimal("-1.0") / BigDecimal("0.0") #=> -Infinity
;T;0o; ;[I"HYou can represent infinite numbers to BigDecimal using the strings ;TI";'Infinity', '+Infinity' and ;TI".'-Infinity' (case-sensitive);T@S;;i;
I"Not a Number;T@o; ;[I"OWhen a computation results in an undefined value, the special value +NaN+ ;TI"&(for 'not a number') is returned.;T@o; ;[I"
Example:;T@o;;[I"3BigDecimal("0.0") / BigDecimal("0.0") #=> NaN
;T;0o; ;[I"*You can also create undefined values.;T@o; ;[I"PNaN is never considered to be the same as any other value, even NaN itself:;T@o;;[I"n = BigDecimal('NaN')
;TI"n == 0.0 #=> false
;TI"n == n #=> false
;T;0S;;i;
I"Positive and negative zero;T@o; ;[I"QIf a computation results in a value which is too small to be represented as ;TI"Pa BigDecimal within the currently specified limits of precision, zero must ;TI"be returned.;T@o; ;[I"QIf the value which is too small to be represented is negative, a BigDecimal ;TI"(value of negative zero is returned.;T@o;;[I":BigDecimal("1.0") / BigDecimal("-Infinity") #=> -0.0
;T;0o; ;[I"DIf the value is positive, a value of positive zero is returned.;T@o;;[I"8BigDecimal("1.0") / BigDecimal("Infinity") #=> 0.0
;T;0o; ;[I"B(See BigDecimal.mode for how to specify limits of precision.);T@o; ;[I"RNote that +-0.0+ and +0.0+ are considered to be the same for the purposes of ;TI"comparison.;T@o; ;[I"ONote also that in mathematics, there is no particular concept of negative ;TI":or positive zero; true mathematical zero has no sign.;T@S;;i;
I"bigdecimal/util;T@o; ;[I"BWhen you require +bigdecimal/util+, the #to_d method will be ;TI"Favailable on BigDecimal and the native Integer, Float, Rational, ;TI"and String classes:;T@o;;[I"require 'bigdecimal/util'
;TI"
;TI"!42.to_d # => 0.42e2
;TI" 0.5.to_d # => 0.5e0
;TI""(2/3r).to_d(3) # => 0.667e0
;TI" "0.5".to_d # => 0.5e0
;T;0S;;i;
I"License;T@o; ;[I"FCopyright (C) 2002 by Shigeo Kobayashi .;T@o; ;[I"FBigDecimal is released under the Ruby and 2-clause BSD licenses. ;TI"!See LICENSE.txt for details.;T@o; ;[I"=Maintained by mrkn and ruby-core members.;T@o; ;[I"QDocumented by zzak , mathew , and ;TI"many other contributors.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0o;;[ ;I"*ext/bigdecimal/lib/bigdecimal/util.rb;T;0o;;[ ;I"(ext/json/lib/json/add/bigdecimal.rb;T;0;0;0[ [U:RDoc::Constant[i I"VERSION;TI"BigDecimal::VERSION;T:public0o;;[o; ;[I"&The version of bigdecimal library;T;@;0@@cRDoc::NormalClass0U;[i I" BASE;TI"BigDecimal::BASE;T;0o;;[o; ;[
I"IBase value used in internal calculations. On a 32 bit system, BASE ;TI"Jis 10000, indicating that calculation is done in groups of 4 digits. ;TI"J(If it were larger, BASE**2 wouldn't fit in 32 bits, so you couldn't ;TI"Kguarantee that two groups could always be multiplied together without ;TI"overflow.);T;@;0@@@0U;[i I"EXCEPTION_ALL;TI"BigDecimal::EXCEPTION_ALL;T;0o;;[o; ;[I"EDetermines whether overflow, underflow or zero divide result in ;TI"4an exception being thrown. See BigDecimal.mode.;T;@;0@@@0U;[i I"EXCEPTION_NaN;TI"BigDecimal::EXCEPTION_NaN;T;0o;;[o; ;[I"GDetermines what happens when the result of a computation is not a ;TI"'number (NaN). See BigDecimal.mode.;T;@;0@@@0U;[i I"EXCEPTION_INFINITY;TI"#BigDecimal::EXCEPTION_INFINITY;T;0o;;[o; ;[I"ADetermines what happens when the result of a computation is ;TI"$infinity. See BigDecimal.mode.;T;@;0@@@0U;[i I"EXCEPTION_UNDERFLOW;TI"$BigDecimal::EXCEPTION_UNDERFLOW;T;0o;;[o; ;[I"DDetermines what happens when the result of a computation is an ;TI"Kunderflow (a result too small to be represented). See BigDecimal.mode.;T;@;0@@@0U;[i I"EXCEPTION_OVERFLOW;TI"#BigDecimal::EXCEPTION_OVERFLOW;T;0o;;[o; ;[I"DDetermines what happens when the result of a computation is an ;TI"Joverflow (a result too large to be represented). See BigDecimal.mode.;T;@;0@@@0U;[i I"EXCEPTION_ZERODIVIDE;TI"%BigDecimal::EXCEPTION_ZERODIVIDE;T;0o;;[o; ;[I"CDetermines what happens when a division by zero is performed. ;TI"See BigDecimal.mode.;T;@;0@@@0U;[i I"ROUND_MODE;TI"BigDecimal::ROUND_MODE;T;0o;;[o; ;[I"GDetermines what happens when a result must be rounded in order to ;TI">fit in the appropriate number of significant digits. See ;TI"BigDecimal.mode.;T;@;0@@@0U;[i I"
ROUND_UP;TI"BigDecimal::ROUND_UP;T;0o;;[o; ;[I"AIndicates that values should be rounded away from zero. See ;TI"BigDecimal.mode.;T;@;0@@@0U;[i I"ROUND_DOWN;TI"BigDecimal::ROUND_DOWN;T;0o;;[o; ;[I"?Indicates that values should be rounded towards zero. See ;TI"BigDecimal.mode.;T;@;0@@@0U;[i I"ROUND_HALF_UP;TI"BigDecimal::ROUND_HALF_UP;T;0o;;[o; ;[I"KIndicates that digits >= 5 should be rounded up, others rounded down. ;TI"See BigDecimal.mode.;T@;@;0@@@0U;[i I"ROUND_HALF_DOWN;TI" BigDecimal::ROUND_HALF_DOWN;T;0o;;[o; ;[I"KIndicates that digits >= 6 should be rounded up, others rounded down. ;TI"See BigDecimal.mode.;T;@;0@@@0U;[i I"ROUND_CEILING;TI"BigDecimal::ROUND_CEILING;T;0o;;[o; ;[I"2Round towards +Infinity. See BigDecimal.mode.;T@;@;0@@@0U;[i I"ROUND_FLOOR;TI"BigDecimal::ROUND_FLOOR;T;0o;;[o; ;[I"2Round towards -Infinity. See BigDecimal.mode.;T@;@;0@@@0U;[i I"ROUND_HALF_EVEN;TI" BigDecimal::ROUND_HALF_EVEN;T;0o;;[o; ;[I":Round towards the even neighbor. See BigDecimal.mode.;T@;@;0@@@0U;[i I"
SIGN_NaN;TI"BigDecimal::SIGN_NaN;T;0o;;[o; ;[I"AIndicates that a value is not a number. See BigDecimal.sign.;T@;@;0@@@0U;[i I"SIGN_POSITIVE_ZERO;TI"#BigDecimal::SIGN_POSITIVE_ZERO;T;0o;;[o; ;[I"7Indicates that a value is +0. See BigDecimal.sign.;T@;@;0@@@0U;[i I"SIGN_NEGATIVE_ZERO;TI"#BigDecimal::SIGN_NEGATIVE_ZERO;T;0o;;[o; ;[I"7Indicates that a value is -0. See BigDecimal.sign.;T@;@;0@@@0U;[i I"SIGN_POSITIVE_FINITE;TI"%BigDecimal::SIGN_POSITIVE_FINITE;T;0o;;[o; ;[I"HIndicates that a value is positive and finite. See BigDecimal.sign.;T@;@;0@@@0U;[i I"SIGN_NEGATIVE_FINITE;TI"%BigDecimal::SIGN_NEGATIVE_FINITE;T;0o;;[o; ;[I"HIndicates that a value is negative and finite. See BigDecimal.sign.;T@;@;0@@@0U;[i I"SIGN_POSITIVE_INFINITE;TI"'BigDecimal::SIGN_POSITIVE_INFINITE;T;0o;;[o; ;[I"JIndicates that a value is positive and infinite. See BigDecimal.sign.;T@;@;0@@@0U;[i I"SIGN_NEGATIVE_INFINITE;TI"'BigDecimal::SIGN_NEGATIVE_INFINITE;T;0o;;[o; ;[I"JIndicates that a value is negative and infinite. See BigDecimal.sign.;T@;@;0@@@0U;[i I"
INFINITY;TI"BigDecimal::INFINITY;T;0o;;[o; ;[I"Special value constants;T@;@;0@@@0U;[i I"NAN;TI"BigDecimal::NAN;T;0o;;[ ;@;0@@@0[ [[I"
class;T[[;[ [:protected[ [:private[[I"
_load;TI" ext/bigdecimal/bigdecimal.c;T[I"double_fig;T@[I"interpret_loosely;T@[I"json_create;TI"(ext/json/lib/json/add/bigdecimal.rb;T[I"
limit;T@[I" mode;T@[I"save_exception_mode;T@[I"save_limit;T@[I"save_rounding_mode;T@[I"
instance;T[[;[ [;[ [;[B[I"%;T@[I"*;T@[I"**;T@[I"+;T@[I"+@;T@[I"-;T@[I"-@;T@[I"/;T@[I"<;T@[I"<=;T@[I"<=>;T@[I"==;T@[I"===;T@[I">;T@[I">=;T@[I"
_dump;T@[I"abs;T@[I"add;T@[I"as_json;T@[I" ceil;T@[I"
clone;T@[I"coerce;T@[I"div;T@[I"divmod;T@[I"dup;T@[I" eql?;T@[I"
exponent;T@[I"finite?;T@[I"fix;T@[I"
floor;T@[I" frac;T@[I" hash;T@[I"infinite?;T@[I"inspect;T@[I"modulo;T@[I" mult;T@[I"n_significant_digits;T@[I" nan?;T@[I"
nonzero?;T@[I"
power;T@[I"precision;T@[I"precision_scale;T@[I"
precs;T@[I"quo;T@[I"remainder;T@[I"
round;T@[I"
scale;T@[I" sign;T@[I"
split;T@[I" sqrt;T@[I"sub;T@[I" to_d;TI"*ext/bigdecimal/lib/bigdecimal/util.rb;T[I"to_digits;T@O[I" to_f;T@[I" to_i;T@[I"to_int;T@[I"to_json;T@[I" to_r;T@[I" to_s;T@[I"
truncate;T@[I"
zero?;T@[ [U:RDoc::Context::Section[i 0o;;[ ;0;0[I" ext/bigdecimal/bigdecimal.c;TI"*ext/bigdecimal/lib/bigdecimal/util.rb;TI"(ext/json/lib/json/add/bigdecimal.rb;T@cRDoc::TopLevelPK ]O,>( (
round-i.rinu [ U:RDoc::AnyMethod[iI"
round:ETI"BigDecimal#round;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"JRound to the nearest integer (by default), returning the result as a ;TI"@BigDecimal if n is specified, or as an Integer if it isn't.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"'BigDecimal('3.14159').round #=> 3
;TI"#BigDecimal('8.7').round #=> 9
;TI"&BigDecimal('-9.9').round #=> -10
;TI"
;TI"@BigDecimal('3.14159').round(2).class.name #=> "BigDecimal"
;TI":BigDecimal('3.14159').round.class.name #=> "Integer"
;T:@format0o;
; [I"NIf n is specified and positive, the fractional part of the result has no ;TI" more than that many digits.;T@o;
; [I"RIf n is specified and negative, at least that many digits to the left of the ;TI"Pdecimal point will be 0 in the result, and return value will be an Integer.;T@o;; [I".BigDecimal('3.14159').round(3) #=> 3.142
;TI"1BigDecimal('13345.234').round(-2) #=> 13300
;T;
0o;
; [I"JThe value of the optional mode argument can be used to determine how ;TI"0rounding is performed; see BigDecimal.mode.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"round(n, mode)
;T0[ I"(p1 = v1, p2 = v2);T@(FI"BigDecimal;TcRDoc::NormalClass00PK ]rP double_fig-c.rinu [ U:RDoc::AnyMethod[iI"double_fig:ETI"BigDecimal::double_fig;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"EReturns the number of digits a Float object is allowed to have; ;TI"$the result is system-dependent:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I""BigDecimal.double_fig # => 16;T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"&BigDecimal.double_fig -> integer
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]?s s nonzero%3f-i.rinu [ U:RDoc::AnyMethod[iI"
nonzero?:ETI"BigDecimal#nonzero?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I":Returns self if the value is non-zero, nil otherwise.;To:RDoc::Markup::BlankLine :
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]F inspect-i.rinu [ U:RDoc::AnyMethod[iI"inspect:ETI"BigDecimal#inspect;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"-Returns a string representation of self.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"%BigDecimal("1234.5678").inspect
;TI" #=> "0.12345678e4";T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]Ń to_digits-i.rinu [ U:RDoc::AnyMethod[iI"to_digits:ETI"BigDecimal#to_digits;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"AConverts a BigDecimal to a String of the form "nnnnnn.mmm". ;TI"AThis method is deprecated; use BigDecimal#to_s("F") instead.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"require 'bigdecimal/util'
;TI"
;TI"d = BigDecimal("3.14")
;TI"-d.to_digits # => "3.14";T:@format0:
@fileI"*ext/bigdecimal/lib/bigdecimal/util.rb;T:0@omit_headings_from_table_of_contents_below0I"a.to_digits -> string
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]
ݫ json_create-c.rinu [ U:RDoc::AnyMethod[iI"json_create:ETI"BigDecimal::json_create;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"%Import a JSON Marshalled object.;To:RDoc::Markup::BlankLine o;
; [I".method used for JSON marshalling support.;T:
@fileI"(ext/json/lib/json/add/bigdecimal.rb;T:0@omit_headings_from_table_of_contents_below000[ I"
(object);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]^yl l
_load-c.rinu [ U:RDoc::AnyMethod[iI"
_load:ETI"BigDecimal::_load;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"QInternal method used to provide marshalling support. See the Marshal module.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]
limit-c.rinu [ U:RDoc::AnyMethod[iI"
limit:ETI"BigDecimal::limit;TT:privateo:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [I"HLimit the number of significant digits in newly created BigDecimal ;TI"Inumbers to the specified value. Rounding is performed as necessary, ;TI"%as specified by BigDecimal.mode.;To:RDoc::Markup::BlankLine o;
; [I"5A limit of 0, the default, means no upper limit.;T@o;
; [I"KThe limit specified by this method takes less priority over any limit ;TI"Kspecified to instance methods such as ceil, floor, truncate, or round.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"BigDecimal.limit(digits)
;T0[ I"(p1 = v1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]:lj j n_significant_digits-i.rinu [ U:RDoc::AnyMethod[iI"n_significant_digits:ETI"$BigDecimal#n_significant_digits;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"@Returns the number of decimal significant digits in +self+.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"*BigDecimal("0").scale # => 0
;TI"*BigDecimal("1").scale # => 1
;TI"*BigDecimal("1.1").scale # => 2
;TI"*BigDecimal("3.1415").scale # => 5
;TI"*BigDecimal("-1e20").precision # => 1
;TI"*BigDecimal("1e-20").precision # => 1
;TI"*BigDecimal("Infinity").scale # => 0
;TI"*BigDecimal("-Infinity").scale # => 0
;TI")BigDecimal("NaN").scale # => 0;T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"%n_significant_digits -> integer
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]$"EU U frac-i.rinu [ U:RDoc::AnyMethod[iI" frac:ETI"BigDecimal#frac;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"?Return the fractional part of the number, as a BigDecimal.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ] eql%3f-i.rinu [ U:RDoc::AnyMethod[iI" eql?:ETI"BigDecimal#eql?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"DTests for value equality; returns true if the values are equal.;To:RDoc::Markup::BlankLine o;
; [I"OThe == and === operators and the eql? method have the same implementation ;TI"for BigDecimal.;T@o;
; [I"5Values may be coerced to perform the comparison:;T@o:RDoc::Markup::Verbatim; [I"'BigDecimal('1.0') == 1.0 #=> true;T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass0[@FI"==;TPK ]dv v finite%3f-i.rinu [ U:RDoc::AnyMethod[iI"finite?:ETI"BigDecimal#finite?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"?Returns True if the value is finite (not NaN or infinite).;To:RDoc::Markup::BlankLine :
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]8[| | coerce-i.rinu [ U:RDoc::AnyMethod[iI"coerce:ETI"BigDecimal#coerce;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"JThe coerce method provides support for Ruby type coercion. It is not ;TI"enabled by default.;To:RDoc::Markup::BlankLine o;
; [I"NThis means that binary operations like + * / or - can often be performed ;TI"Lon a BigDecimal and an object of another type, if the other object can ;TI"(be coerced into a BigDecimal value.;T@o;
; [I" e.g.;To:RDoc::Markup::Verbatim; [I"a = BigDecimal("1.0")
;TI"b = a / 2.0 #=> 0.5
;T:@format0o;
; [I"NNote that coercing a String to a BigDecimal is not supported by default; ;TI"Bit requires a special compile-time option when building Ruby.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I" (p1);T@ FI"BigDecimal;TcRDoc::NormalClass00PK ][; to_i-i.rinu [ U:RDoc::AnyMethod[iI" to_i:ETI"BigDecimal#to_i;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"%Returns the value as an Integer.;To:RDoc::Markup::BlankLine o;
; [I"CIf the BigDecimal is infinity or NaN, raises FloatDomainError.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[[I"to_int;T@ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]iX7 %2b%40-i.rinu [ U:RDoc::AnyMethod[iI"+@:ETI"BigDecimal#+@;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Returns +self+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I" +BigDecimal(5) # => 0.5e1
;TI" +BigDecimal(-5) # => -0.5e1;T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"+big_decimal -> self
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]Jf! %2a-i.rinu [ U:RDoc::AnyMethod[iI"*:ETI"BigDecimal#*;TF:privateo:RDoc::Markup::Document:@parts[ :
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]z interpret_loosely-c.rinu [ U:RDoc::AnyMethod[iI"interpret_loosely:ETI""BigDecimal::interpret_loosely;TT:privateo:RDoc::Markup::Document:@parts[ :
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]Ysi i
_dump-i.rinu [ U:RDoc::AnyMethod[iI"
_dump:ETI"BigDecimal#_dump;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I">Returns a string representing the marshalling of +self+. ;TI"See module Marshal.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"0inf = BigDecimal('Infinity') # => Infinity
;TI"4dumped = inf._dump # => "9:Infinity"
;TI"/BigDecimal._load(dumped) # => Infinity;T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"_dump -> string
;T0[ I"(p1 = v1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]%+= = precision_scale-i.rinu [ U:RDoc::AnyMethod[iI"precision_scale:ETI"BigDecimal#precision_scale;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"?Returns a 2-length array; the first item is the result of ;TI"DBigDecimal#precision and the second one is of BigDecimal#scale.;To:RDoc::Markup::BlankLine o;
; [I"See BigDecimal#precision. ;TI"See BigDecimal#scale.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"+precision_scale -> [integer, integer]
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]< < div-i.rinu [ U:RDoc::AnyMethod[iI"div:ETI"BigDecimal#div;TF:privateo:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [I"#Divide by the specified value.;To:RDoc::Markup::BlankLine o:RDoc::Markup::List:
@type: NOTE:@items[o:RDoc::Markup::ListItem:@label[I"digits;T; [o;
; [I"HIf specified and less than the number of significant digits of the ;TI"Gresult, the result is rounded to that number of digits, according ;TI"to BigDecimal.mode.;T@o;
; [I"BIf digits is 0, the result is the same as for the / operator ;TI"
or #quo.;T@o;
; [I";If digits is not specified, the result is an integer, ;TI";by analogy with Float#div; see also BigDecimal#divmod.;T@o;
; [I"See BigDecimal#/. ;TI"See BigDecimal#quo.;T@o;
; [I"Examples:;T@o:RDoc::Markup::Verbatim; [I"a = BigDecimal("4")
;TI"b = BigDecimal("3")
;TI"
;TI"a.div(b, 3) # => 0.133e1
;TI"
;TI"/a.div(b, 0) # => 0.1333333333333333333e1
;TI"/a / b # => 0.1333333333333333333e1
;TI"/a.quo(b) # => 0.1333333333333333333e1
;TI"
;TI"a.div(b) # => 1;T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"Idiv(value) -> integer
div(value, digits) -> bigdecimal or integer
;T0[ I"(p1, p2 = v2);T@5FI"BigDecimal;TcRDoc::NormalClass00PK ].w w save_exception_mode-c.rinu [ U:RDoc::AnyMethod[iI"save_exception_mode:ETI"$BigDecimal::save_exception_mode;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"@Execute the provided block, but preserve the exception mode;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"'BigDecimal.save_exception_mode do
;TI"> BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
;TI"9 BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
;TI"
;TI"* BigDecimal(BigDecimal('Infinity'))
;TI"+ BigDecimal(BigDecimal('-Infinity'))
;TI"% BigDecimal(BigDecimal('NaN'))
;TI" end
;T:@format0o;
; [I"-For use with the BigDecimal::EXCEPTION_*;T@o;
; [I"See BigDecimal.mode;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I",BigDecimal.save_exception_mode { ... }
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]Y` ` nan%3f-i.rinu [ U:RDoc::AnyMethod[iI" nan?:ETI"BigDecimal#nan?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"/Returns True if the value is Not a Number.;To:RDoc::Markup::BlankLine :
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ] 7 to_d-i.rinu [ U:RDoc::AnyMethod[iI" to_d:ETI"BigDecimal#to_d;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Returns self.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"require 'bigdecimal/util'
;TI"
;TI"d = BigDecimal("3.14")
;TI".d.to_d # => 0.314e1;T:@format0:
@fileI"*ext/bigdecimal/lib/bigdecimal/util.rb;T:0@omit_headings_from_table_of_contents_below0I"a.to_d -> bigdecimal
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]ׅ %3c%3d-i.rinu [ U:RDoc::AnyMethod[iI"<=:ETI"BigDecimal#<=;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"RReturns +true+ if +self+ is less or equal to than +other+, +false+ otherwise:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"'b = BigDecimal('1.5') # => 0.15e1
;TI"%b <= 2 # => true
;TI"%b <= 2.0 # => true
;TI"%b <= Rational(2, 1) # => true
;TI"%b <= 1.5 # => true
;TI"&b < 1 # => false
;T:@format0o;
; [I":Raises an exception if the comparison cannot be made.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"$self <= other -> true or false
;T0[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]xF
precs-i.rinu [ U:RDoc::AnyMethod[iI"
precs:ETI"BigDecimal#precs;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"NReturns an Array of two Integer values that represent platform-dependent ;TI"!internal storage properties.;To:RDoc::Markup::BlankLine o;
; [ I"BThis method is deprecated and will be removed in the future. ;TI"NInstead, use BigDecimal#n_significant_digits for obtaining the number of ;TI"Msignificant digits in scientific notation, and BigDecimal#precision for ;TI"8obtaining the number of digits in decimal notation.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"precs -> array
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ] dup-i.rinu [ U:RDoc::AnyMethod[iI"dup:ETI"BigDecimal#dup;TF:privateo:RDoc::Markup::Document:@parts[ :
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"BigDecimal;TcRDoc::NormalClass0[@FI"
clone;TPK ]fdkZ Z
split-i.rinu [ U:RDoc::AnyMethod[iI"
split:ETI"BigDecimal#split;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"PSplits a BigDecimal number into four parts, returned as an array of values.;To:RDoc::Markup::BlankLine o;
; [I"QThe first value represents the sign of the BigDecimal, and is -1 or 1, or 0 ;TI"'if the BigDecimal is Not a Number.;T@o;
; [I"MThe second value is a string representing the significant digits of the ;TI"'BigDecimal, with no leading zeros.;T@o;
; [I"QThe third value is the base used for arithmetic (currently always 10) as an ;TI"
Integer.;T@o;
; [I"-The fourth value is an Integer exponent.;T@o;
; [I"PIf the BigDecimal can be represented as 0.xxxxxx*10**n, then xxxxxx is the ;TI"Ostring of significant digits with no leading zeros, and n is the exponent.;T@o;
; [I"MFrom these values, you can translate a BigDecimal to a float as follows:;T@o:RDoc::Markup::Verbatim; [I"8sign, significant_digits, base, exponent = a.split
;TI"Df = sign * "0.#{significant_digits}".to_f * (base ** exponent)
;T:@format0o;
; [I"R(Note that the to_f method is provided as a more convenient way to translate ;TI"a BigDecimal to a Float.);T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@-FI"BigDecimal;TcRDoc::NormalClass00PK ]ŀD infinite%3f-i.rinu [ U:RDoc::AnyMethod[iI"infinite?:ETI"BigDecimal#infinite?;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FReturns nil, -1, or +1 depending on whether the value is finite, ;TI"-Infinity, or +Infinity.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]N/ %3e%3d-i.rinu [ U:RDoc::AnyMethod[iI">=:ETI"BigDecimal#>=;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"UReturns +true+ if +self+ is greater than or equal to +other+, +false+ otherwise:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"b = BigDecimal('1.5')
;TI"#b >= 1 # => true
;TI"#b >= 1.0 # => true
;TI"#b >= Rational(1, 1) # => true
;TI"#b >= 1.5 # => true
;TI"$b > 2 # => false
;T:@format0o;
; [I":Raises an exception if the comparison cannot be made.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"$self >= other -> true or false
;T0[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]Wc c precision-i.rinu [ U:RDoc::AnyMethod[iI"precision:ETI"BigDecimal#precision;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"4Returns the number of decimal digits in +self+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I".BigDecimal("0").precision # => 0
;TI".BigDecimal("1").precision # => 1
;TI".BigDecimal("1.1").precision # => 2
;TI".BigDecimal("3.1415").precision # => 5
;TI"/BigDecimal("-1e20").precision # => 21
;TI"/BigDecimal("1e-20").precision # => 20
;TI".BigDecimal("Infinity").precision # => 0
;TI".BigDecimal("-Infinity").precision # => 0
;TI"-BigDecimal("NaN").precision # => 0;T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"precision -> integer
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]U
truncate-i.rinu [ U:RDoc::AnyMethod[iI"
truncate:ETI"BigDecimal#truncate;TF:privateo:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [I"MTruncate to the nearest integer (by default), returning the result as a ;TI"BigDecimal.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"*BigDecimal('3.14159').truncate #=> 3
;TI"&BigDecimal('8.7').truncate #=> 8
;TI"(BigDecimal('-9.9').truncate #=> -9
;T:@format0o;
; [I"NIf n is specified and positive, the fractional part of the result has no ;TI" more than that many digits.;T@o;
; [I"RIf n is specified and negative, at least that many digits to the left of the ;TI"+decimal point will be 0 in the result.;T@o;; [I"1BigDecimal('3.14159').truncate(3) #=> 3.141
;TI"5BigDecimal('13345.234').truncate(-2) #=> 13300.0;T;
0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"truncate(n)
;T0[ I"(p1 = v1);T@!FI"BigDecimal;TcRDoc::NormalClass00PK ]b %3e-i.rinu [ U:RDoc::AnyMethod[iI">:ETI"BigDecimal#>;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"IReturns +true+ if +self+ is greater than +other+, +false+ otherwise:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"b = BigDecimal('1.5')
;TI""b > 1 # => true
;TI""b > 1.0 # => true
;TI""b > Rational(1, 1) # => true
;TI"#b > 2 # => false
;T:@format0o;
; [I":Raises an exception if the comparison cannot be made.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"#self > other -> true or false
;T0[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]MV %2a%2a-i.rinu [ U:RDoc::AnyMethod[iI"**:ETI"BigDecimal#**;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"EReturns the \BigDecimal value of +self+ raised to power +other+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"b = BigDecimal('3.14')
;TI"(b ** 2 # => 0.98596e1
;TI"(b ** 2.0 # => 0.98596e1
;TI"(b ** Rational(2, 1) # => 0.98596e1
;T:@format0o;
; [I"Related: BigDecimal#power.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"!self ** other -> bigdecimal
;T0[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]њ# # %2f-i.rinu [ U:RDoc::AnyMethod[iI"/:ETI"BigDecimal#/;TF:privateo:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [I"#Divide by the specified value.;To:RDoc::Markup::BlankLine o;
; [I"GThe result precision will be the precision of the larger operand, ;TI"%but its minimum is 2*Float::DIG.;T@o;
; [I"See BigDecimal#div. ;TI"See BigDecimal#quo.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"a / b -> bigdecimal
;T0[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]I as_json-i.rinu [ U:RDoc::AnyMethod[iI"as_json:ETI"BigDecimal#as_json;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I" Marshal the object to JSON.;To:RDoc::Markup::BlankLine o;
; [I".method used for JSON marshalling support.;T:
@fileI"(ext/json/lib/json/add/bigdecimal.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(*);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]C C to_json-i.rinu [ U:RDoc::AnyMethod[iI"to_json:ETI"BigDecimal#to_json;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"return the JSON value;T:
@fileI"(ext/json/lib/json/add/bigdecimal.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(*args);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]֗ to_s-i.rinu [ U:RDoc::AnyMethod[iI" to_s:ETI"BigDecimal#to_s;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"$Converts the value to a string.;To:RDoc::Markup::BlankLine o;
; [I".The default format looks like 0.xxxxEnn.;T@o;
; [I"PThe optional parameter s consists of either an integer; or an optional '+' ;TI"Por ' ', followed by an optional number, followed by an optional 'E' or 'F'.;T@o;
; [I"LIf there is a '+' at the start of s, positive values are returned with ;TI"a leading '+'.;T@o;
; [I"LA space at the start of s returns positive values with a leading space.;T@o;
; [I"OIf s contains a number, a space is inserted after each group of that many ;TI"fractional digits.;T@o;
; [I"EIf s ends with an 'E', engineering notation (0.xxxxEnn) is used.;T@o;
; [I"IIf s ends with an 'F', conventional floating point notation is used.;T@o;
; [I"Examples:;T@o:RDoc::Markup::Verbatim; [
I"5BigDecimal('-123.45678901234567890').to_s('5F')
;TI"& #=> '-123.45678 90123 45678 9'
;TI"
;TI"5BigDecimal('123.45678901234567890').to_s('+8F')
;TI"$ #=> '+123.45678901 23456789'
;TI"
;TI"4BigDecimal('123.45678901234567890').to_s(' F')
;TI"" #=> ' 123.4567890123456789';T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"
to_s(s)
;T0[ I"(p1 = v1);T@4FI"BigDecimal;TcRDoc::NormalClass00PK ]aN mult-i.rinu [ U:RDoc::AnyMethod[iI" mult:ETI"BigDecimal#mult;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I";Returns the \BigDecimal product of +self+ and +value+ ;TI"2with a precision of +ndigits+ decimal digits.;To:RDoc::Markup::BlankLine o;
; [I"BWhen +ndigits+ is less than the number of significant digits ;TI">in the sum, the sum is rounded to that number of digits, ;TI"Aaccording to the current rounding mode; see BigDecimal.mode.;T@o;
; [I"Examples:;T@o:RDoc::Markup::Verbatim; [I"# Set the rounding mode.
;TI"7BigDecimal.mode(BigDecimal::ROUND_MODE, :half_up)
;TI""b = BigDecimal('555555.555')
;TI"3b.mult(3, 0) # => 0.1666666665e7
;TI",b.mult(3, 3) # => 0.167e7
;TI"/b.mult(3, 6) # => 0.166667e7
;TI"3b.mult(3, 15) # => 0.1666666665e7
;TI"3b.mult(3.0, 0) # => 0.1666666665e7
;TI"3b.mult(Rational(3, 1), 0) # => 0.1666666665e7
;TI"9b.mult(Complex(3, 0), 0) # => (0.1666666665e7+0.0i);T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"(mult(other, ndigits) -> bigdecimal
;T0[ I"
(p1, p2);T@$FI"BigDecimal;TcRDoc::NormalClass00PK ]v add-i.rinu [ U:RDoc::AnyMethod[iI"add:ETI"BigDecimal#add;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"7Returns the \BigDecimal sum of +self+ and +value+ ;TI"2with a precision of +ndigits+ decimal digits.;To:RDoc::Markup::BlankLine o;
; [I"BWhen +ndigits+ is less than the number of significant digits ;TI">in the sum, the sum is rounded to that number of digits, ;TI"Aaccording to the current rounding mode; see BigDecimal.mode.;T@o;
; [I"Examples:;T@o:RDoc::Markup::Verbatim; [I"# Set the rounding mode.
;TI"7BigDecimal.mode(BigDecimal::ROUND_MODE, :half_up)
;TI""b = BigDecimal('111111.111')
;TI"2b.add(1, 0) # => 0.111112111e6
;TI",b.add(1, 3) # => 0.111e6
;TI"/b.add(1, 6) # => 0.111112e6
;TI"2b.add(1, 15) # => 0.111112111e6
;TI"2b.add(1.0, 15) # => 0.111112111e6
;TI"1b.add(Rational(1, 1), 15) # => 0.111112111e6;T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"+add(value, ndigits) -> new_bigdecimal
;T0[ I"
(p1, p2);T@#FI"BigDecimal;TcRDoc::NormalClass00PK ] to_int-i.rinu [ U:RDoc::AnyMethod[iI"to_int:ETI"BigDecimal#to_int;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"%Returns the value as an Integer.;To:RDoc::Markup::BlankLine o;
; [I"CIf the BigDecimal is infinity or NaN, raises FloatDomainError.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"BigDecimal;TcRDoc::NormalClass0[@FI" to_i;TPK ]c sign-i.rinu [ U:RDoc::AnyMethod[iI" sign:ETI"BigDecimal#sign;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"#Returns the sign of the value.;To:RDoc::Markup::BlankLine o;
; [I"EReturns a positive value if > 0, a negative value if < 0, and a ;TI"zero if == 0.;T@o;
; [I"PThe specific value returned indicates the type and sign of the BigDecimal, ;TI"as follows:;T@o:RDoc::Markup::List:
@type: NOTE:@items[o:RDoc::Markup::ListItem:@label[I"BigDecimal::SIGN_NaN;T; [o;
; [I"value is Not a Number;To;;[I"#BigDecimal::SIGN_POSITIVE_ZERO;T; [o;
; [I"value is +0;To;;[I"#BigDecimal::SIGN_NEGATIVE_ZERO;T; [o;
; [I"value is -0;To;;[I"'BigDecimal::SIGN_POSITIVE_INFINITE;T; [o;
; [I"value is +Infinity;To;;[I"'BigDecimal::SIGN_NEGATIVE_INFINITE;T; [o;
; [I"value is -Infinity;To;;[I"%BigDecimal::SIGN_POSITIVE_FINITE;T; [o;
; [I"value is positive;To;;[I"%BigDecimal::SIGN_NEGATIVE_FINITE;T; [o;
; [I"value is negative;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below000[ I"();T@JFI"BigDecimal;TcRDoc::NormalClass00PK ]W} %3c-i.rinu [ U:RDoc::AnyMethod[iI"<:ETI"BigDecimal#<;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"FReturns +true+ if +self+ is less than +other+, +false+ otherwise:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"'b = BigDecimal('1.5') # => 0.15e1
;TI"%b < 2 # => true
;TI"%b < 2.0 # => true
;TI"%b < Rational(2, 1) # => true
;TI"&b < 1.5 # => false
;T:@format0o;
; [I":Raises an exception if the comparison cannot be made.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"#self < other -> true or false
;T0[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]A.\ \ divmod-i.rinu [ U:RDoc::AnyMethod[iI"divmod:ETI"BigDecimal#divmod;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"JDivides by the specified value, and returns the quotient and modulus ;TI"Nas BigDecimal numbers. The quotient is rounded towards negative infinity.;To:RDoc::Markup::BlankLine o;
; [I"For example:;T@o:RDoc::Markup::Verbatim; [I"require 'bigdecimal'
;TI"
;TI"a = BigDecimal("42")
;TI"b = BigDecimal("9")
;TI"
;TI"q, m = a.divmod(b)
;TI"
;TI"c = q * b + m
;TI"
;TI"a == c #=> true
;T:@format0o;
; [I"OThe quotient q is (a/b).floor, and the modulus is the amount that must be ;TI"added to q * b to get a.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"divmod(value)
;T0[ I" (p1);T@#FI"BigDecimal;TcRDoc::NormalClass00PK ]fO O
scale-i.rinu [ U:RDoc::AnyMethod[iI"
scale:ETI"BigDecimal#scale;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"QReturns the number of decimal digits following the decimal digits in +self+.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"*BigDecimal("0").scale # => 0
;TI"*BigDecimal("1").scale # => 1
;TI"*BigDecimal("1.1").scale # => 1
;TI"*BigDecimal("3.1415").scale # => 4
;TI"*BigDecimal("-1e20").precision # => 0
;TI"+BigDecimal("1e-20").precision # => 20
;TI"*BigDecimal("Infinity").scale # => 0
;TI"*BigDecimal("-Infinity").scale # => 0
;TI")BigDecimal("NaN").scale # => 0;T:@format0:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"scale -> integer
;T0[ I"();T@FI"BigDecimal;TcRDoc::NormalClass00PK ]xC sqrt-i.rinu [ U:RDoc::AnyMethod[iI" sqrt:ETI"BigDecimal#sqrt;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"*Returns the square root of the value.;To:RDoc::Markup::BlankLine o;
; [I".Result has at least n significant digits.;T:
@fileI" ext/bigdecimal/bigdecimal.c;T:0@omit_headings_from_table_of_contents_below0I"
sqrt(n)
;T0[ I" (p1);T@FI"BigDecimal;TcRDoc::NormalClass00PK ]lP P fix-i.rinu [ U:RDoc::AnyMethod[iI"fix:ETI"BigDecimal#fix;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"