package ctypes

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module ComplexLSource

Sourcetype t

The type of long double complex values

Sourceval make : LDouble.t -> LDouble.t -> t

make x y creates the long double complex value x + y * i

Sourceval of_complex : Complex.t -> t

create a long double complex from a Complex.t

Sourceval to_complex : t -> Complex.t

Convert a long double complex to a Complex.t. The real and imaginary components are converted by calling LDouble.to_float which can produce unspecified results.

Sourceval zero : t

0 + i0

Sourceval one : t

1 + i0

Sourceval i : t

0 + i

Sourceval re : t -> LDouble.t

return the real part of the long double complex

Sourceval im : t -> LDouble.t

return the imaginary part of the long double complex

Sourceval neg : t -> t

Unary negation

Sourceval conj : t -> t

Conjugate: given the complex x + i.y, returns x - i.y.

Sourceval add : t -> t -> t

Addition

Sourceval sub : t -> t -> t

Subtraction

Sourceval mul : t -> t -> t

Multiplication

Sourceval div : t -> t -> t

Division

Sourceval inv : t -> t

Multiplicative inverse (1/z).

Sourceval sqrt : t -> t

Square root.

Sourceval norm2 : t -> LDouble.t

Norm squared: given x + i.y, returns x^2 + y^2.

Sourceval norm : t -> LDouble.t

Norm: given x + i.y, returns sqrt(x^2 + y^2).

Sourceval polar : LDouble.t -> LDouble.t -> t

polar norm arg returns the complex having norm norm and argument arg.

Sourceval arg : t -> LDouble.t

Argument. The argument of a complex number is the angle in the complex plane between the positive real axis and a line passing through zero and the number.

Sourceval exp : t -> t

Exponentiation. exp z returns e to the z power.

Sourceval log : t -> t

Natural logarithm (in base e).

Sourceval pow : t -> t -> t

Power function. pow z1 z2 returns z1 to the z2 power.

OCaml

Innovation. Community. Security.