complex.nim: reformating [other]

This commit is contained in:
Andreas Rumpf 2019-06-09 09:18:19 +02:00
commit 8317de7648

View file

@ -7,10 +7,6 @@
# distribution, for details about the copyright. # distribution, for details about the copyright.
# #
## This module implements complex numbers. ## This module implements complex numbers.
## Complex numbers are currently implemented as generic on a 64-bit or 32-bit float. ## Complex numbers are currently implemented as generic on a 64-bit or 32-bit float.
@ -42,8 +38,8 @@ proc complex64*(re: float64; im: float64 = 0.0): Complex[float64] =
template im*(arg: typedesc[float32]): Complex32 = complex[float32](0, 1) template im*(arg: typedesc[float32]): Complex32 = complex[float32](0, 1)
template im*(arg: typedesc[float64]): Complex64 = complex[float64](0, 1) template im*(arg: typedesc[float64]): Complex64 = complex[float64](0, 1)
template im*(arg : float32): Complex32 = complex[float32](0, arg) template im*(arg: float32): Complex32 = complex[float32](0, arg)
template im*(arg : float64): Complex64 = complex[float64](0, arg) template im*(arg: float64): Complex64 = complex[float64](0, arg)
proc abs*[T](z: Complex[T]): T = proc abs*[T](z: Complex[T]): T =
## Return the distance from (0,0) to ``z``. ## Return the distance from (0,0) to ``z``.