Skip to content

cdt.math ​

Floating-point mathematical functions and constants (Float).

Import ​

conduit
import * as math from "cdt.math"
// or
import { pi, sqrt, pow, sin, cos } from "cdt.math"

Constants & Functions ​

FunctionSignatureDescription
pimath.pi() -> FloatReturns π (3.141592653589793).
emath.e() -> FloatReturns Euler's number e.
taumath.tau() -> FloatReturns 2π.
sqrtmath.sqrt(x: Float) -> FloatSquare root of x.
powmath.pow(base: Float, exp: Float) -> FloatRaises base to exp.
hypotmath.hypot(a: Float, b: Float) -> FloatComputes $\sqrt{a^2 + b^2}$ without intermediate overflow.
sin, cos, tanmath.<fn>(x: Float) -> FloatTrigonometric functions (radians).
asin, acos, atanmath.<fn>(x: Float) -> FloatInverse trigonometric functions.
atan2math.atan2(y: Float, x: Float) -> FloatFour-quadrant arctangent.
exp, ln, log10math.<fn>(x: Float) -> FloatExponential (e^x), natural log, and base-10 log.
floor, ceil, round, truncmath.<fn>(x: Float) -> FloatRounding functions returning Float.