Complex(3)
β¨ NAME β¨
okay so bestie, this is literally Complex from the OCaml library π and it is about Complex numbers. no cap, that is the whole name vibe. we are keeping every single detail, periodt.
π Module π
the module is literally Module Complex, and its signature opens with : sig end β that is the whole shape of it, bestie π«Ά.
π Documentation π
Complex numbers. 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). slay, that is the whole setup β¨.
the type is giving record realness:
type t = {
re : float ;
im : float ;
}
this is the type of complex numbers. re is the real part and im is the imaginary part. iconic little pair, no notes π
.
val zero : tβ the complex number0. πval one : tβ the complex number1. πΈval i : tβ the complex numberi. π¦val neg : t -> tβ unary negation. πval conj : t -> tβ conjugate: given the complexx + i.y, returnsx - i.y. π«val add : t -> t -> tβ addition. βval sub : t -> t -> tβ subtraction. βval mul : t -> t -> tβ multiplication. βοΈval inv : t -> tβ multiplicative inverse (1/z). πval div : t -> t -> tβ division. βval sqrt : t -> tβ square root. the resultx + i.yis such thatx > 0orx = 0andy >= 0. this function has a discontinuity along the negative real axis. β οΈval norm2 : t -> floatβ norm squared: givenx + i.y, returnsx^2 + y^2. π₯val norm : t -> floatβ norm: givenx + i.y, returnssqrt(x^2 + y^2). πval arg : t -> floatβ 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-pitopi. this function has a discontinuity along the negative real axis. βval polar : float -> float -> tβpolar norm argreturns the complex having normnormand argumentarg. πval exp : t -> tβ exponentiation.exp zreturnseto thezpower. πval log : t -> tβ natural logarithm (in basee). πΏval pow : t -> t -> tβ power function.pow z1 z2returnsz1to thez2power. π₯
okay that is the whole page bestie β source/version is OCamldoc, date is 2026-06-22, and the page is Complex(3). mwah πβ¨
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms