Next: Random Numbers, Previous: Bitwise Operations, Up: Numbers
These mathematical functions allow integers as well as floating-point numbers as arguments.
These are the basic trigonometric functions, with argument arg measured in radians.
The value of
(asinarg)is a number between −pi/2 and pi/2 (inclusive) whose sine is arg. If arg is out of range (outside [−1, 1]),asinreturns a NaN.
The value of
(acosarg)is a number between 0 and pi (inclusive) whose cosine is arg. If arg is out of range (outside [−1, 1]),acosreturns a NaN.
The value of
(atany)is a number between −pi/2 and pi/2 (exclusive) whose tangent is y. If the optional second argument x is given, the value of(atan y x)is the angle in radians between the vector[x,y]and theXaxis.
This function returns the logarithm of arg, with base base. If you don't specify base, the natural base e is used. If arg or base is negative,
logreturns a NaN.
This function returns x raised to power y. If both arguments are integers and y is positive, the result is an integer; in this case, overflow causes truncation, so watch out. If x is a finite negative number and y is a finite non-integer,
exptreturns a NaN.
This returns the square root of arg. If arg is finite and less than zero,
sqrtreturns a NaN.
In addition, Emacs defines the following common mathematical constants: