This module implements complex numbers.
Complex = tuple[re, im: float]
im: Complex = (re: 0.0, im: 1.0)
proc toComplex(x: SomeInteger): Complex
x
to a complex number. proc `==`(x, y: Complex): bool {...}{.raises: [], tags: [].}
proc `=~`(x, y: Complex): bool {...}{.raises: [], tags: [].}
proc `+`(x, y: Complex): Complex {...}{.raises: [], tags: [].}
proc `+`(x: Complex; y: float): Complex {...}{.raises: [], tags: [].}
proc `+`(x: float; y: Complex): Complex {...}{.raises: [], tags: [].}
proc `-`(z: Complex): Complex {...}{.raises: [], tags: [].}
proc `-`(x, y: Complex): Complex {...}{.raises: [], tags: [].}
proc `-`(x: Complex; y: float): Complex {...}{.raises: [], tags: [].}
proc `-`(x: float; y: Complex): Complex {...}{.raises: [], tags: [].}
proc `/`(x, y: Complex): Complex {...}{.raises: [], tags: [].}
proc `/`(x: Complex; y: float): Complex {...}{.raises: [], tags: [].}
proc `/`(x: float; y: Complex): Complex {...}{.raises: [], tags: [].}
proc `*`(x, y: Complex): Complex {...}{.raises: [], tags: [].}
proc `*`(x: float; y: Complex): Complex {...}{.raises: [], tags: [].}
proc `*`(x: Complex; y: float): Complex {...}{.raises: [], tags: [].}
proc `+=`(x: var Complex; y: Complex) {...}{.raises: [], tags: [].}
proc `+=`(x: var Complex; y: float) {...}{.raises: [], tags: [].}
proc `-=`(x: var Complex; y: Complex) {...}{.raises: [], tags: [].}
proc `-=`(x: var Complex; y: float) {...}{.raises: [], tags: [].}
proc `*=`(x: var Complex; y: Complex) {...}{.raises: [], tags: [].}
proc `*=`(x: var Complex; y: float) {...}{.raises: [], tags: [].}
proc `/=`(x: var Complex; y: Complex) {...}{.raises: [], tags: [].}
proc `/=`(x: var Complex; y: float) {...}{.raises: [], tags: [].}
proc abs(z: Complex): float {...}{.raises: [], tags: [].}
proc conjugate(z: Complex): Complex {...}{.raises: [], tags: [].}
proc sqrt(z: Complex): Complex {...}{.raises: [], tags: [].}
proc exp(z: Complex): Complex {...}{.raises: [], tags: [].}
proc ln(z: Complex): Complex {...}{.raises: [], tags: [].}
proc log10(z: Complex): Complex {...}{.raises: [], tags: [].}
proc log2(z: Complex): Complex {...}{.raises: [], tags: [].}
proc pow(x, y: Complex): Complex {...}{.raises: [], tags: [].}
proc sin(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arcsin(z: Complex): Complex {...}{.raises: [], tags: [].}
proc cos(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arccos(z: Complex): Complex {...}{.raises: [], tags: [].}
proc tan(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arctan(z: Complex): Complex {...}{.raises: [], tags: [].}
proc cot(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arccot(z: Complex): Complex {...}{.raises: [], tags: [].}
proc sec(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arcsec(z: Complex): Complex {...}{.raises: [], tags: [].}
proc csc(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arccsc(z: Complex): Complex {...}{.raises: [], tags: [].}
proc sinh(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arcsinh(z: Complex): Complex {...}{.raises: [], tags: [].}
proc cosh(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arccosh(z: Complex): Complex {...}{.raises: [], tags: [].}
proc tanh(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arctanh(z: Complex): Complex {...}{.raises: [], tags: [].}
proc sech(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arcsech(z: Complex): Complex {...}{.raises: [], tags: [].}
proc csch(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arccsch(z: Complex): Complex {...}{.raises: [], tags: [].}
proc coth(z: Complex): Complex {...}{.raises: [], tags: [].}
proc arccoth(z: Complex): Complex {...}{.raises: [], tags: [].}
proc phase(z: Complex): float {...}{.raises: [], tags: [].}
proc polar(z: Complex): tuple[r, phi: float] {...}{.raises: [], tags: [].}
proc rect(r: float; phi: float): Complex {...}{.raises: [], tags: [].}
proc `$`(z: Complex): string {...}{.raises: [], tags: [].}
"(re, im)"
.
© 2006–2018 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/complex.html