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.t
0
.val one : Complex.t
1
.val i : Complex.t
i
.val neg : Complex.t -> Complex.t
val conj : Complex.t -> Complex.t
x + i.y
, returns x - i.y
.val add : Complex.t -> Complex.t -> Complex.t
val sub : Complex.t -> Complex.t -> Complex.t
val mul : Complex.t -> Complex.t -> Complex.t
val inv : Complex.t -> Complex.t
1/z
).val div : Complex.t -> Complex.t -> Complex.t
val sqrt : Complex.t -> Complex.t
x + 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 -> float
x + i.y
, returns x^2 + y^2
.val norm : Complex.t -> float
x + 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.t
polar norm arg
returns the complex having norm norm
and argument arg
.val exp : Complex.t -> Complex.t
exp z
returns e
to the z
power.val log : Complex.t -> Complex.t
e
).val pow : Complex.t -> Complex.t -> Complex.t
pow z1 z2
returns z1
to the z2
power.val operations : Complex.t BatNumber.numeric
val inv : Complex.t -> Complex.t
inv x
returns the value of 1/x
val succ : Complex.t -> Complex.t
BatComplex.one
to this number.val pred : Complex.t -> Complex.t
BatComplex.one
from this number.val abs : Complex.t -> Complex.t
abs 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.t
val pow : Complex.t -> Complex.t -> Complex.t
val compare : Complex.t -> Complex.t -> int
val of_int : int -> Complex.t
val to_int : Complex.t -> int
val of_string : string -> Complex.t
val to_string : Complex.t -> string
val (+) : Complex.t -> Complex.t -> Complex.t
val (-) : Complex.t -> Complex.t -> Complex.t
val ( * ) : Complex.t -> Complex.t -> Complex.t
val (/) : Complex.t -> Complex.t -> Complex.t
val ( ** ) : Complex.t -> Complex.t -> Complex.t
val (<>) : Complex.t -> Complex.t -> bool
val (>=) : Complex.t -> Complex.t -> bool
val (<=) : Complex.t -> Complex.t -> bool
val (>) : Complex.t -> Complex.t -> bool
val (<) : Complex.t -> Complex.t -> bool
val (=) : Complex.t -> Complex.t -> bool
val print : 'a BatInnerIO.output -> Complex.t -> unit