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]].
(complex re)
(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.
(complex? a)
Returns true if a
is an instance of [[Complex]], false otherwise.
Returns true if `a` is an instance of [[Complex]], false otherwise.
(gaussian-integer? z)
Returns true if z
is a Gaussian
integer, i.e., a complex entry
with integral real and imaginary components.
gaussian-integer?
will return true if the real and imaginary components
are within epsilon
of integral values. See value/almost-integral?
for
details.
Returns true if `z` is a [Gaussian integer](https://en.wikipedia.org/wiki/Gaussian_integer), i.e., a complex entry with integral real and imaginary components. [[gaussian-integer?]] will return true if the real and imaginary components are within `epsilon` of integral values. See [[value/almost-integral?]] for details.
(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.
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.
A [[Complex]] value equal to 0 (south pole on the Riemann Sphere).
A [[Complex]] value equal to 0 (south pole on the Riemann Sphere).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close