elisp: Math Functions
3.9 Standard Mathematical Functions
===================================
These mathematical functions allow integers as well as floating-point
numbers as arguments.
-- Function: sin arg
-- Function: cos arg
-- Function: tan arg
These are the basic trigonometric functions, with argument ARG
measured in radians.
-- Function: asin arg
The value of ‘(asin ARG)’ is a number between −pi/2 and pi/2
(inclusive) whose sine is ARG. If ARG is 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 is ARG. If ARG is 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 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 the ‘X’ axis.
-- Function: exp arg
This is the exponential function; it returns e to the power ARG.
-- Function: log arg &optional base
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, ‘log’ returns a NaN.
-- Function: expt x y
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, ‘expt’ returns a
NaN.
-- Function: sqrt arg
This returns the square root of ARG. If ARG is finite and less
than zero, ‘sqrt’ returns a NaN.
In addition, Emacs defines the following common mathematical
constants:
-- Variable: float-e
The mathematical constant e (2.71828...).
-- Variable: float-pi
The mathematical constant pi (3.14159...).