prev - up - next - index

Math

The modules for the floating point arithmetic. The Math module has methods and modules methods of the same definitions in same names.

Example:

pi = Math.atan2(1, 1) * 4;
include Math
pi2 = atan2(1, 1)

Module Functions:
atan2(x, y)

Returns the arc tangent of the two variable x and y, which is between -PI and PI.

cos(x)
sin(x)
tan(x)

Returns the cosine, sine, tangent, respectively, of x, where x is given in radians, which is between -1 and 1.

exp(x)

Returns the value of e raised to the power of x.

log(x)

Returns the natural logarithm of x.

log10(x)

Returns the base-10 logarithm of x.

sqrt(x)

Returns non-negative square root of x. It raises an exception, if x is negative.

Constants:
PI

The pi.

E

The e.


prev - up - next - index

matz@caelum.co.jp