Path: | rdoc/math.rdoc |
Last Update: | Sun Nov 14 22:53:48 +0000 2010 |
Contents:
The base of exponentials, e
The base-2 logarithm of e, log_2(e)
The base-10 logarithm of e, log_10(e)
The square root of two, sqrt(2)
The square root of one-half, sqrt(1/2)
The square root of three, sqrt(3)
The constant pi
Pi divided by two
Pi divided by four
The square root of pi
Two divided by the square root of pi
The reciprocal of pi, 1/pi
Twice the reciprocal of pi, 2/pi
The natural logarithm of ten, ln(10)
The natural logarithm of ten, ln(2)
The natural logarithm of ten, ln(pi)
Euler‘s constant
The IEEE representation of positive infinity, computed from the expression +1.0/0.0.
The IEEE representation of negative infinity, computed from the expression -1.0/0.0.
The IEEE representation of the Not-a-Number symbol, computed from the ratio 0.0/0.0.
This returns 1 if x is not-a-number.
This returns true if x is not-a-number, and false otherwise.
This returns +1 if x is positive infinity, -1 if x is negative infinity and 0 otherwise. NOTE: In Darwin9.5.0-gcc4.0.1, this method returns 1 for -inf.
This returns true if x is positive or negative infinity, and false otherwise.
This returns 1 if x is a real number, and 0 if it is infinite or not-a-number.
This returns true if x is a real number, and false if it is infinite or not-a-number.
This method computes the value of log(1+x) in a way that is accurate for small x. It provides an alternative to the BSD math function log1p(x).
This method computes the value of exp(x)-1 in a way that is accurate for small x. It provides an alternative to the BSD math function expm1(x).
This method computes the value of sqrt{x^2 + y^2} in a way that avoids overflow.
Computes the value of sqrt{x^2 + y^2 + z^2} in a way that avoids overflow.
This method computes the value of arccosh(x).
This method computes the value of arcsinh(x).
This method computes the value of arctanh(x).
These methods above can take argument x of Integer, Float, Array, Vector or Matrix.
This method computes the value of x * 2^e.
This method splits the number x into its normalized fraction f and exponent e, such that x = f * 2^e and 0.5 <= f < 1. The method returns f and the exponent e as an array, [f, e]. If x is zero, both f and e are set to zero.
This routine computes the power x^n for integer n. The power is computed efficiently — for example, x^8 is computed as ((x^2)^2)^2, requiring only 3 multiplications.
These methods can be used to compute small integer powers x^2, x^3, etc. efficiently.
Return the sign of x. It is defined as ((x) >= 0 ? 1 : -1). Note that with this definition the sign of zero is positive (regardless of its IEEE sign bit).
Evaluate to 1 if n is odd and 0 if n is even. The argument n must be of Fixnum type.
Return true if n is odd and false if even.
Evaluate to 1 if n is even and 0 if n is odd. The argument n must be of Fixnum type.
Return true if n is even and false if odd.
This method determines whether x and y are approximately equal to a relative accuracy epsilon.
GSL version
Ruby/GSL version