variable-precision-0.1: variable-precision floating point

PortabilityDeriveDataTypeable, GeneralizedNewtypeDeriving
Stabilityprovisional
Maintainerclaudiusmaximus@goto10.org
Safe HaskellNone

Numeric.VariablePrecision.Complex

Description

Newtype wrapper around Complex. When both of Complex and this module need to be imported, use qualified imports.

Synopsis

Documentation

newtype VComplex p Source

Newtype wrapper around Complex so that instances can be written for HasPrecision and VariablePrecision.

Constructors

C 

Fields

toComplex :: Complex (VFloat p)
 

(.+) :: VFloat p -> VFloat p -> VComplex pSource

Alike to :+, constructs a complex number from a real part and an imaginary part.

withComplex :: (Complex (VFloat p) -> Complex (VFloat q)) -> VComplex p -> VComplex qSource

Lift an operation on Complex to one on VComplex.

realPart :: NaturalNumber p => VComplex p -> VFloat pSource

Real part.

imagPart :: NaturalNumber p => VComplex p -> VFloat pSource

Imaginary part.

magnitude :: NaturalNumber p => VComplex p -> VFloat pSource

Magnitude.

magnitude2 :: NaturalNumber p => VComplex p -> VFloat pSource

Magnitude squared.

polar :: NaturalNumber p => VComplex p -> (VFloat p, VFloat p)Source

Polar form.

cis :: NaturalNumber p => VFloat p -> VComplex pSource

Unit at phase.

mkPolar :: NaturalNumber p => VFloat p -> VFloat p -> VComplex pSource

From polar form.