  GNU-Darwin Web
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)*4
```

## Module Functions:

`atan2(y, x)`

Returns the arc tangent of the two variable x and y in radian, 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.

`frexp(x)`

Returns the nomalized fraction and an the exponent.

`ldexp(x,exp)`

Returns the result of multiplying the floating-point number x by 2 raised to the power of exp.

`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@netlab.co.jp