Stdlib.Complex(3)
π Stdlib.Complex(3) π
bestie, this is the OCaml library page for Stdlib.Complex β the complex-number module that's lowkey serving math main-character energy. it's giving complex-plane couture, no cap β¨
πΈ NAME πΈ
Stdlib.Complex β no description (yes, the manpage itself said no description; mysterious icon behavior, we respect it π
).
π Module π
Module Stdlib.Complex β that's the module we're talking about, periodt.
β¨ Documentation β¨
Module Complex : (module Stdlib__Complex) β yes bestie, the alias reveal π«Ά
type t = {
re : float ;
im : float ;
}
The type of complex numbers. re is the real part and im is the imaginary part. π
val zero : tβ the complex number0. zero bestie.val one : tβ the complex number1. iconic.val i : tβ the complex numberi. imaginary legend behavior.val neg : t -> tβ unary negation. flip the sign, slay.val conj : t -> tβ conjugate: given the complexx + i.y, returnsx - i.y. mirror moment β¨val add : t -> t -> tβ addition. putting things together, we love to see it.val sub : t -> t -> tβ subtraction. taking things away, okay.val mul : t -> t -> tβ multiplication. math girlies rise.val inv : t -> tβ multiplicative inverse (1/z). reciprocal realness.val div : t -> t -> tβ division. sharing is caring but with numbers.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. (yes, dramatic but true.)val norm2 : t -> floatβ norm squared: givenx + i.y, returnsx^2 + y^2. squared, not sorry.val norm : t -> floatβ norm: givenx + i.y, returnssqrt(x^2 + y^2). the actual norm vibe check.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. angle tea π«val polar : float -> float -> tβpolar norm argreturns the complex having normnormand argumentarg. polar coords, cute.val exp : t -> tβ exponentiation.exp zreturnseto thezpower. exponential era.val log : t -> tβ natural logarithm (in basee). log bestie.val pow : t -> t -> tβ power function.pow z1 z2returnsz1to thez2power. raise it up π₯
mwah β OCamldoc, 2026-06-22, Stdlib.Complex(3) π
π¦ 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