Tea — a strongly typed scripting languageCompiles native via LLVM
Tea
DocsPlaygroundExamplesReferenceCommunity
GitHub

Tea Language

A strongly typed scripting language for native tools.

© 2026 Tea Language.

ContributingCommunityRepository

Language Runtime

Built-ins

Standard Library

std.argsstd.assertstd.audiostd.encodingstd.envstd.fsstd.hashstd.httpstd.netstd.jsonstd.mathstd.parsestd.pathstd.processstd.randomstd.regexstd.stringstd.timestd.url

Standard Library

std.math

Extended math: powers, logarithms, trigonometry, and float utilities.

Exported functions

pub def pi() -> Float

Return pi.

pub def e() -> Float

Return Euler's number e.

pub def pow(base: Float, exponent: Float) -> Float

Raise base to the given power.

pub def exp(value: Float) -> Float

Return e raised to the given power.

pub def log(value: Float) -> Float

Return the natural logarithm.

pub def log2(value: Float) -> Float

Return the base-2 logarithm.

pub def log10(value: Float) -> Float

Return the base-10 logarithm.

pub def sin(value: Float) -> Float

Return the sine of an angle in radians.

pub def cos(value: Float) -> Float

Return the cosine of an angle in radians.

pub def tan(value: Float) -> Float

Return the tangent of an angle in radians.

pub def asin(value: Float) -> Float

Return the arcsine in radians.

pub def acos(value: Float) -> Float

Return the arccosine in radians.

pub def atan(value: Float) -> Float

Return the arctangent in radians.

pub def atan2(y: Float, x: Float) -> Float

Return the four-quadrant arctangent of y/x in radians.

pub def hypot(x: Float, y: Float) -> Float

Return sqrt(x^2 + y^2) without intermediate overflow.

pub def trunc(value: Float) -> Int

Truncate toward zero, returning an Int.

pub def sign(value: Float) -> Int

Return -1, 0, or 1 according to the sign of the value.

pub def clamp(value: Float, low: Float, high: Float) -> Float

Clamp a value into the inclusive range [low, high].

pub def floor(value: Float) -> Int

Round down to the nearest integer (same as the @floor builtin).

pub def ceil(value: Float) -> Int

Round up to the nearest integer (same as the @ceil builtin).

pub def round(value: Float) -> Int

Round to the nearest integer (same as the @round builtin).

pub def abs(value: Float) -> Float

Return the absolute value (same as the @abs builtin).

pub def sqrt(value: Float) -> Float

Return the square root (same as the @sqrt builtin).

pub def min(a: Float, b: Float) -> Float

Return the smaller of two values (same as the @min builtin).

pub def max(a: Float, b: Float) -> Float

Return the larger of two values (same as the @max builtin).