API Reference › Percent
namespace

Percent

A value clamped to [0, 1] — health fractions, volumes, and the t of an interpolation, without stray values slipping below 0 or above 1. Percent.clamp pins any fixed into range; Percent.of forms a clamped ratio num / den; Percent.lerp interpolates a..b by a clamped t; and Percent.apply scales a value by a clamped fraction. Every operation is deterministic fixed-point. Arguments are positional. Spliced in only when a program mentions Percent.*.

Percent.clamp(v) -> fixedClamp any fixed into [0, 1].Percent.of(num, den) -> fixedClamped ratio num / den.Percent.lerp(a, b, t) -> fixedInterpolate a..b by a clamped t.Percent.apply(value, p) -> fixedScale a value by a clamped percent.
← All symbols