module BatComplex:Additional and modified functions for complex numbers.sig..end
This module provides arithmetic operations on complex numbers.
Complex numbers are represented by their real and imaginary parts
(cartesian representation). Each part is represented by a
double-precision floating-point number (type float).
This module extends Stdlib's
Complex
module, go there for documentation on the rest of the functions
and types.
val zero : Complex.t0.val one : Complex.t1.val i : Complex.ti.val neg : Complex.t -> Complex.tval conj : Complex.t -> Complex.tx + i.y, returns x - i.y.val add : Complex.t -> Complex.t -> Complex.tval sub : Complex.t -> Complex.t -> Complex.tval mul : Complex.t -> Complex.t -> Complex.tval inv : Complex.t -> Complex.t1/z).val div : Complex.t -> Complex.t -> Complex.tval sqrt : Complex.t -> Complex.tx + i.y is such that x > 0 or
x = 0 and y >= 0.
This function has a discontinuity along the negative real axis.val norm2 : Complex.t -> floatx + i.y, returns x^2 + y^2.val norm : Complex.t -> floatx + i.y, returns sqrt(x^2 + y^2).val arg : Complex.t -> float-pi to pi. This function has a discontinuity along the
negative real axis.val polar : float -> float -> Complex.tpolar norm arg returns the complex having norm norm
and argument arg.val exp : Complex.t -> Complex.texp z returns e to the z power.val log : Complex.t -> Complex.te).val pow : Complex.t -> Complex.t -> Complex.tpow z1 z2 returns z1 to the z2 power.val operations : Complex.t BatNumber.numericval inv : Complex.t -> Complex.tinv x returns the value of 1/xval succ : Complex.t -> Complex.tBatComplex.one to this number.val pred : Complex.t -> Complex.tBatComplex.one from this number.val abs : Complex.t -> Complex.tabs c returns the module of this complex number,
i.e. abs c = Float.sqrt((re c) *. (re c) +. (im c) *. (im c) )val modulo : Complex.t -> Complex.t -> Complex.tval pow : Complex.t -> Complex.t -> Complex.tval compare : Complex.t -> Complex.t -> intval of_int : int -> Complex.tval to_int : Complex.t -> intval of_string : string -> Complex.tval to_string : Complex.t -> stringval (+) : Complex.t -> Complex.t -> Complex.tval (-) : Complex.t -> Complex.t -> Complex.tval ( * ) : Complex.t -> Complex.t -> Complex.tval (/) : Complex.t -> Complex.t -> Complex.tval ( ** ) : Complex.t -> Complex.t -> Complex.tval (<>) : Complex.t -> Complex.t -> boolval (>=) : Complex.t -> Complex.t -> boolval (<=) : Complex.t -> Complex.t -> boolval (>) : Complex.t -> Complex.t -> boolval (<) : Complex.t -> Complex.t -> boolval (=) : Complex.t -> Complex.t -> boolval print : 'a BatInnerIO.output -> Complex.t -> unit