Namespace: clojure.math
Functions
abs
(abs x)Returns the absolute value of x.
acos
(acos x)Returns the arc cosine of x, in the range [0, π].
asin
(asin x)Returns the arc sine of x, in the range [-π/2, π/2].
atan
(atan x)Returns the arc tangent of x, in the range (-π/2, π/2).
atan2
(atan2 y x)Returns the angle θ from the conversion of rectangular coordinates (x, y) to polar (r, θ). Arguments are y first, then x.
cbrt
(cbrt x)Returns the cube root of x.
ceil
(ceil x)Returns the smallest integer value ≥ x.
cos
(cos x)Returns the trigonometric cosine of angle x in radians.
cosh
(cosh x)Returns the hyperbolic cosine of x.
exp
(exp x)Returns Euler's number e raised to the power of x.
floor
(floor x)Returns the largest integer value ≤ x.
floor-div
(floor-div x y)Returns the largest integer ≤ (/ x y). Unlike quot, floor-div rounds toward negative infinity rather than zero.
floor-mod
(floor-mod x y)Returns x - (floor-div x y) * y. Unlike rem, the result has the same sign as y.
hypot
(hypot x y)Returns sqrt(x² + y²), avoiding intermediate overflow or underflow.
log
(log x)Returns the natural logarithm (base e) of x.
log10
(log10 x)Returns the base-10 logarithm of x.
pow
(pow x y)Returns x raised to the power of y.
rint
(rint x)Returns the integer closest to x, with ties rounding to the nearest even integer (IEEE 754 round-half-to-even / banker's rounding).
round
(round x)Returns the closest integer to x, with ties rounding up (half-up).
signum
(signum x)Returns -1.0, 0.0, or 1.0 indicating the sign of x.
sin
(sin x)Returns the trigonometric sine of angle x in radians.
sinh
(sinh x)Returns the hyperbolic sine of x.
sqrt
(sqrt x)Returns the positive square root of x.
tan
(tan x)Returns the trigonometric tangent of angle x in radians.
tanh
(tanh x)Returns the hyperbolic tangent of x.
to-degrees
(to-degrees rad)Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
to-radians
(to-radians deg)Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
Special Vars
E
2.718281828459045
The base of the natural logarithms.
PI
3.141592653589793
The ratio of the circumference of a circle to its diameter.
TAU
6.283185307179586
The ratio of the circumference of a circle to its radius (2 * PI).