Ruby Math Functions

EditRocket provides the following information on Math functions in the Ruby source code builder.

acos(x) - Computes the arc cosine of x. Returns 0..PI.

acosh(x) - Computes the inverse hyperbolic cosine of x.

asin(x) - Computes the arc sine of x. Returns 0..PI.

asinh(x) - Computes the inverse hyperbolic sine of x.

atan(x) - Computes the arc tangent of x. Returns -{PI/2} .. {PI/2}.

atan2(y, x) - Computes the arc tangent given y and x. Returns -PI..PI.

atanh(x) - Computes the inverse hyperbolic tangent of x.

cos(x) - Computes the cosine of x (expressed in radians). Returns -1..1.

cosh(x) - Computes the hyperbolic cosine of x (expressed in radians).

erf(x) - Calculates the error function of x.

erfc(x) - Calculates the complementary error function of x.

exp(x) - Returns e**x.

frexp(numeric) - Returns a two-element array containing the normalized fraction (a Float) and exponent (a Fixnum) of numeric.

hypot(x, y) - Returns sqrt(x**2 + y**2), the hypotenuse of a right-angled triangle with sides x and y.

ldexp(flt, int) - Returns the value of flt*(2**int).

log(numeric) - Returns the natural logarithm of numeric.

log10(numeric) - Returns the base 10 logarithm of numeric.

new -

rsqrt(a) -

sin(x) - Computes the sine of x (expressed in radians). Returns -1..1.

sinh(x) - Computes the hyperbolic sine of x (expressed in radians).

sqrt(numeric) - Returns the non-negative square root of numeric.

tan(x) - Returns the tangent of x (expressed in radians).

tanh() - Computes the hyperbolic tangent of x (expressed in radians).