Next: Random Numbers, Previous: Bitwise Operations, Up: Numbers

These mathematical functions allow integers as well as floating point numbers as arguments.

— Function: **sin**` arg`

— Function:**cos**` arg`

— Function:**tan**` arg`

— Function:

— Function:

These are the basic trigonometric functions, with argument

argmeasured in radians.

— Function: **asin**` arg`

The value of

`(asin`

arg`)`

is a number between −pi/2 and pi/2 (inclusive) whose sine isarg. Ifargis out of range (outside [−1, 1]),`asin`

returns a NaN.

— Function: **acos**` arg`

The value of

`(acos`

arg`)`

is a number between 0 and pi (inclusive) whose cosine isarg. Ifargis out of range (outside [−1, 1]),`acos`

returns a NaN.

— Function: **atan**` y &optional x`

The value of

`(atan`

y`)`

is a number between −pi/2 and pi/2 (exclusive) whose tangent isy. If the optional second argumentxis given, the value of`(atan y x)`

is the angle in radians between the vector`[`

x`,`

y`]`

and the`X`

axis.

— Function: **log**` arg &optional base`

This function returns the logarithm of

arg, with basebase. If you don't specifybase, the natural base e is used. Ifargorbaseis negative,`log`

returns a NaN.

— Function: **log10**` arg`

This function returns the logarithm of

arg, with base 10:`(log10`

x`)`

==`(log`

x`10)`

.

— Function: **expt**` x y`

This function returns

xraised to powery. If both arguments are integers andyis positive, the result is an integer; in this case, overflow causes truncation, so watch out. Ifxis a finite negative number andyis a finite non-integer,`expt`

returns a NaN.

In addition, Emacs defines the following common mathematical constants: