Numlex Documentation
Using Numlex
Report issue

Variables & functions

Assign values with name = expression, reuse them anywhere, and call the built-in math functions.

Variables let a sheet carry state the way a notebook carries marginal notes. Declare a value with name = expression; the name then stands for that value in every later line.

Assignments

hotel = 1240          1,240
hotel + 10%           1,364

room = 180 × 4        720
round(room / 3, 2)    240

Reassign any time — later lines see the new value, and any answer tokens that reference the line update live (see Linked answers).

Using functions

The engine shares one pure function registry across every scalar path — free expressions, assignments, constants and unitless answer tokens. Names are case-insensitive, arguments are full expressions (nesting included), and a function-shaped line is strict: an unknown name, a bad arity, a bad comma or a domain failure is a precise error, never a guess.

FunctionMeaning
sqrt, abssquare root, absolute value
round(x) / round(x, d)round, ties away from zero
min, max, sum, averageone or more arguments
pow(b, e)same finite contract as ^
ln(x), log(x), log(x, b), log10(x)natural / base-10 / arbitrary / base-10
sin, cos, tantrigonometric, radians
asin, acos, ataninverse trigonometric
radians(d), degrees(r)explicit unit helpers
sqrt(144)             12
sum(1, 2, 3)          6
pow(2, 10)            1,024
log10(1000)           3
sin(radians(30))      0.5

Commas inside calls

Inside an argument list a comma separates arguments. A comma directly before exactly three digits is still a thousands separator, so sum(1, 234) is two arguments while sum(1,234) is one grouped literal — and 1,234,567 outside a call is one number.

Built-ins activate only in call position: a variable or constant named sum still works in sum + 1, while sum(1, 2) calls the function.

Units and money in functions

Answer tokens join the same engine when they are unitless: sqrt(<token>) and <token> ^ 2 evaluate with the token as a live argument. Unit-bearing and money tokens passed to a function or to ^ fail safely instead of losing their unit.

Found an issue in these docs? Report it on GitHub .