Liking cljdoc? Tell your friends :D

Numbers

Clojure Numbers

Operations on the Clojure numeric datatypes that are part of standard Clojure are listed here without comment; those that are not part of standard Clojure are described. In the following <n> is (any expression that denotes) an integer. <a> is any real number, <z> is any complex number, and <x> and <y> are any kind of number.

(kind <x>)            = *number*
(exact? <x>)          ;;=> <boolean>
(negative? x)         ;;=> <boolean>
(zero-like <x>)       = 0
(one-like <x>)        = 1
(zero? <x>)           ;;=> <boolean>
(one? <x>)            ;;=> <boolean>

(negate <x>), (invert <x>), (sqrt <x>)

(exp <x>), (exp10 <x>), (exp2 <x>)

(log <x>), (log10 <x>), (log2 <x>)

(sin <x>), (cos <x>), (tan <x>), (sec <x>), (csc <x>)

(asin <x>), (acos <x>), (atan <x>)
(atan <x1> <x2>)

(sinh <x>), (cosh <x>), (tanh <x>), (sech <x>), (csch <x>)

(asinh <x>), (acosh <x>), (atanh <x>)

(= <x1> <x2> ...)    ;;=> <boolean>
(+ <x1> <x2> ...)
(* <x1> <x2> ...)
(- <x1> <x2> ...)
(/ <x1> <x2> ...)

(expt <x1> <x2>)

(abs <x>)
(quotient <n1> <n2>)
(remainder <n1> <n2>)
(modulo <n1> <n2>)
(exact-divide <n1> <n2>)

(gcd <n1> <n2>)
(lcm <n1> <n2>)

(make-rectangular <a1> <a2>) ==  <a1>+i<a2>
(make-polar <a1> <a2>)       ==  <a1>*:e^(* +i <a2>)
(real-part <z>)
(imag-part <z>)
(magnitude <z>)
(angle <z>)

(conjugate <z>)

(transpose <a>)           == a
(dimension <a>)           == 1
(dot-product <a1> <a2>)   == (* <a1> <a2>)
(inner-product <a1> <a2>) == (* (conjugate <a1>) <a2>)

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close