| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
NumHask.Data.Complex
Description
Complex numbers.
Documentation
The underlying representation is a newtype-wrapped tuple, compared with the base datatype. This was chosen to facilitate the use of DerivingVia.
Constructors
| Complex | |
Fields
| |
Instances
(+:) :: a -> a -> Complex a infixl 6 Source #
Complex number constructor.
Internally, Complex derives most instances via EuclideanPair. For instance,
>>>sqrt (1.0 +: (-1.0)) :: Complex DoubleComplex {complexPair = (1.0986841134678098,-0.45508986056222733)}
>>>sqrt ((-1.0) +: 0.0) :: Complex DoubleComplex {complexPair = (6.123233995736766e-17,1.0)}