336 lines
3.3 KiB
HTML
336 lines
3.3 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Stdlib.Complex</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Stdlib.Complex</H1>
|
|
Section: OCaml library (3o)<BR>Updated: 2020-01-30<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Stdlib.Complex - no description
|
|
<A NAME="lbAC"> </A>
|
|
<H2>Module</H2>
|
|
|
|
Module Stdlib.Complex
|
|
<A NAME="lbAD"> </A>
|
|
<H2>Documentation</H2>
|
|
|
|
<P>
|
|
Module
|
|
<B>Complex</B>
|
|
|
|
<BR> :
|
|
<B>(module Stdlib__complex)</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>type t </I>
|
|
|
|
= {
|
|
<BR> re :
|
|
<B>float</B>
|
|
|
|
;
|
|
<BR> im :
|
|
<B>float</B>
|
|
|
|
;
|
|
<BR> }
|
|
<P>
|
|
<P>
|
|
The type of complex numbers.
|
|
<B>re</B>
|
|
|
|
is the real part and
|
|
<B>im</B>
|
|
|
|
the
|
|
imaginary part.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val zero </I>
|
|
|
|
:
|
|
<B>t</B>
|
|
|
|
<P>
|
|
The complex number
|
|
<B>0</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val one </I>
|
|
|
|
:
|
|
<B>t</B>
|
|
|
|
<P>
|
|
The complex number
|
|
<B>1</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val i </I>
|
|
|
|
:
|
|
<B>t</B>
|
|
|
|
<P>
|
|
The complex number
|
|
<B>i</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val neg </I>
|
|
|
|
:
|
|
<B>t -> t</B>
|
|
|
|
<P>
|
|
Unary negation.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val conj </I>
|
|
|
|
:
|
|
<B>t -> t</B>
|
|
|
|
<P>
|
|
Conjugate: given the complex
|
|
<B>x + i.y</B>
|
|
|
|
, returns
|
|
<B>x - i.y</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val add </I>
|
|
|
|
:
|
|
<B>t -> t -> t</B>
|
|
|
|
<P>
|
|
Addition
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val sub </I>
|
|
|
|
:
|
|
<B>t -> t -> t</B>
|
|
|
|
<P>
|
|
Subtraction
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val mul </I>
|
|
|
|
:
|
|
<B>t -> t -> t</B>
|
|
|
|
<P>
|
|
Multiplication
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val inv </I>
|
|
|
|
:
|
|
<B>t -> t</B>
|
|
|
|
<P>
|
|
Multiplicative inverse (
|
|
<B>1/z</B>
|
|
|
|
).
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val div </I>
|
|
|
|
:
|
|
<B>t -> t -> t</B>
|
|
|
|
<P>
|
|
Division
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val sqrt </I>
|
|
|
|
:
|
|
<B>t -> t</B>
|
|
|
|
<P>
|
|
Square root. The result
|
|
<B>x + i.y</B>
|
|
|
|
is such that
|
|
<B>x > 0</B>
|
|
|
|
or
|
|
<B>x = 0</B>
|
|
|
|
and
|
|
<B>y >= 0</B>
|
|
|
|
.
|
|
This function has a discontinuity along the negative real axis.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val norm2 </I>
|
|
|
|
:
|
|
<B>t -> float</B>
|
|
|
|
<P>
|
|
Norm squared: given
|
|
<B>x + i.y</B>
|
|
|
|
, returns
|
|
<B>x^2 + y^2</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val norm </I>
|
|
|
|
:
|
|
<B>t -> float</B>
|
|
|
|
<P>
|
|
Norm: given
|
|
<B>x + i.y</B>
|
|
|
|
, returns
|
|
<B>sqrt(x^2 + y^2)</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val arg </I>
|
|
|
|
:
|
|
<B>t -> float</B>
|
|
|
|
<P>
|
|
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. This angle ranges from
|
|
<B>-pi</B>
|
|
|
|
to
|
|
<B>pi</B>
|
|
|
|
. This function has a discontinuity along the
|
|
negative real axis.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val polar </I>
|
|
|
|
:
|
|
<B>float -> float -> t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>polar norm arg</B>
|
|
|
|
returns the complex having norm
|
|
<B>norm</B>
|
|
|
|
and argument
|
|
<B>arg</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val exp </I>
|
|
|
|
:
|
|
<B>t -> t</B>
|
|
|
|
<P>
|
|
Exponentiation.
|
|
<B>exp z</B>
|
|
|
|
returns
|
|
<B>e</B>
|
|
|
|
to the
|
|
<B>z</B>
|
|
|
|
power.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val log </I>
|
|
|
|
:
|
|
<B>t -> t</B>
|
|
|
|
<P>
|
|
Natural logarithm (in base
|
|
<B>e</B>
|
|
|
|
).
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val pow </I>
|
|
|
|
:
|
|
<B>t -> t -> t</B>
|
|
|
|
<P>
|
|
Power function.
|
|
<B>pow z1 z2</B>
|
|
|
|
returns
|
|
<B>z1</B>
|
|
|
|
to the
|
|
<B>z2</B>
|
|
|
|
power.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">Module</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">Documentation</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:57 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|