Liking cljdoc? Tell your friends :D

emmy.complex

This namespace provides a number of functions and constructors for working with [[Complex]] numbers in Clojure and ClojureScript, and installs [[Complex]] into the Emmy generic arithmetic system.

For other numeric extensions, see emmy.ratio and [[emmy.numbers]].

This namespace provides a number of functions and constructors for working
with [[Complex]] numbers in Clojure and ClojureScript, and
installs [[Complex]] into the Emmy generic arithmetic system.

For other numeric extensions, see [[emmy.ratio]]
and [[emmy.numbers]].
raw docstring

-Iclj/s

A [[Complex]] value equal to -i.

A [[Complex]] value equal to `-i`.
sourceraw docstring

complexclj/s

(complex c)
(complex re im)

Returns a [[Complex]] number with the supplied real part re and imaginary part im. im defaults to 0.

Returns a [[Complex]] number with the supplied real part `re` and imaginary
part `im`. `im` defaults to 0.
sourceraw docstring

complex?clj/s

(complex? a)

Returns true if a is an instance of [[Complex]], false otherwise.

Returns true if `a` is an instance of [[Complex]], false otherwise.
sourceraw docstring

Iclj/s

A [[Complex]] value equal to i.

A [[Complex]] value equal to `i`.
sourceraw docstring

ONEclj/s

A [[Complex]] value equal to 1.

A [[Complex]] value equal to 1.
sourceraw docstring

parse-complexclj/s

(parse-complex c)

Used as a data reader. In Clojure, we could get away with just using the constructor above, but in ClojureScript we need to act as a macro to delay evaluation of the constructor.

Used as a [data reader](https://www.clojurescript.org/guides/reader#_clojurescript_compilation).
In Clojure, we could get away with just using the constructor above, but in
ClojureScript we need to act as a macro to delay evaluation of the constructor.
sourceraw docstring

roundclj/s

(round z)

Generates a Gaussian integer from the complex number z by rounding the real and imaginary components of z to their nearest integral values. (Note: the use of cast-to-double is unfortunate here, as complex numbers can now contain exact fractions, and we'd want a nearest integer generic function for those)

Generates a [Gaussian integer](https://en.wikipedia.org/wiki/Gaussian_integer)
from the complex number `z` by rounding the real and imaginary components of
`z` to their nearest integral values. (Note: the use of cast-to-double is
 unfortunate here, as complex numbers can now contain exact fractions, and
 we'd want a nearest integer generic function for those)
sourceraw docstring

ZEROclj/s

A [[Complex]] value equal to 0 (south pole on the Riemann Sphere).

A [[Complex]] value equal to 0 (south pole on the Riemann Sphere).
sourceraw docstring

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

× close