E

E(prec) Instance Public methods Computes e (the base of natural logarithms) to the specified number of digits of precision.

log

BigMath.log(x, prec) Class Public methods Computes the natural logarithm of x to the specified number of digits of precision. If x is zero or negative, raises Math::DomainError. If x is positive infinity, returns Infinity. If x is NaN, returns NaN.

exp

BigMath.exp(x, prec) Class Public methods Computes the value of e (the base of natural logarithms) raised to the power of x, to the specified number of digits of precision. If x is infinity, returns Infinity. If x is NaN, returns NaN.

zero?

zero?() Instance Public methods Returns True if the value is zero.

truncate

truncate(n) Instance Public methods Truncate to the nearest 1, returning the result as a BigDecimal. BigDecimal('3.14159').truncate #=> 3 BigDecimal('8.7').truncate #=> 8 If n is specified and positive, the fractional part of the result has no more than that many digits. If n is specified and negative, at least that many digits to the left of the decimal point will be 0 in the result. BigDecimal('3.14159').truncate(3) #=> 3.141 BigDecimal('13345.234').truncate(-2) #=>

to_s

to_s(s) Instance Public methods Converts the value to a string. The default format looks like 0.xxxxEnn. The optional parameter s consists of either an integer; or an optional '+' or ' ', followed by an optional number, followed by an optional 'E' or 'F'. If there is a '+' at the start of s, positive values are returned with a leading '+'. A space at the start of s returns positive values with a leading space. If s contains a number, a space is inserted after each group of that m

to_r

to_r() Instance Public methods Converts a BigDecimal to a Rational.

to_json

to_json(*) Instance Public methods return the JSON value

to_int

to_int() Instance Public methods Returns the value as an integer (Fixnum or Bignum). If the BigNumber is infinity or NaN, raises FloatDomainError.

to_i

to_i() Instance Public methods Returns the value as an integer (Fixnum or Bignum). If the BigNumber is infinity or NaN, raises FloatDomainError.