Built-in functions
All 23 math functions with arity, domains and examples, plus call syntax, nesting and argument separators.
Numlex ships exactly 23 built-in functions — all scalar, all strict. There is
no e or pi built in, calls are case-insensitive, and a call that is
misspelled or given the wrong number of arguments is a visible error rather
than a zero.
This page lists the call rules, the argument-separator behavior that follows
the regional number format (round(1.25, 0) versus round(1,25; 0)), and a
complete table of the 23 functions with their domains and verified examples.
Call syntax
Write name(arg1, arg2, …). Function names are case-insensitive
(SQRT(9) = sqrt(9)), and a space before ( is allowed.
Calls are strict. An unknown name, the wrong number of arguments, a missing or extra comma, an unclosed parenthesis, or a value outside the function’s domain is an error — deterministically, never a guess. A call-shaped line is part of the strict contract described in Sheet language: an unknown function name is an error rather than a parenthesized group.
In call position a built-in function takes precedence over a variable with
the same name — sum = 5 does not stop sum(1, 2). Everywhere else, sum
is an ordinary identifier.
Functions are scalar (they do not take or return units), and nested calls are
allowed: sqrt(abs(-16)) → 4.
No built-in constants
There are no built-in e or pi constants. ln(e) does not evaluate unless
e itself was declared first (e = 2.71828…). The same applies to pi:
declare it as a named value or a Settings constant if you need it.
Argument separators and commas
The separator follows the regional number format:
- Dot-decimal formats (North America, System with a dot): the argument
separator is
,—round(1.25, 0). - Comma-decimal formats (Western Europe, Eastern Europe, System with a
comma): the decimal separator is a comma and the argument separator is
;—round(1,25; 0)= 1.
Commas inside a call are read by shape:
| Input | Interpretation |
|---|---|
sum(1,234) | one number (1234) — a grouping comma needs exactly three digits after it and an integer part before it |
sum(1, 234) | two arguments |
sum(1,2,3) | three arguments |
1,234,567 | one number (outside calls) |
The 23 functions
| Function | Args | Meaning | Domain | Example |
|---|---|---|---|---|
sqrt | 1 | square root | x ≥ 0 | sqrt(16) → 4 |
abs | 1 | absolute value | any | abs(-3) → 3 |
round | 1–2 | rounding (away from zero); the 2nd argument is an integer digit count −15…15 | integer digits | round(2.5) → 3, round(2.345, 2) → 2.35 |
min | ≥1 | minimum | — | min(3, 1, 2) → 1 |
max | ≥1 | maximum | — | max(1, 2) → 2 |
sum | ≥1 | sum | — | sum(1, 2, 3) → 6 |
average | ≥1 | average (overflow-safe) | — | average(1, 2, 3) → 2 |
pow | 2 | power (same contract as ^) | finite result | pow(2, 10) → 1024 |
ln | 1 | natural logarithm | x > 0 | ln(1) → 0 |
log | 1–2 | logarithm: 1 argument — base 10; 2 arguments — base b | x > 0; b > 0, b ≠ 1 | log(100) → 2, log(8, 2) → 3 |
log10 | 1 | base-10 logarithm | x > 0 | log10(1000) → 3 |
sin | 1 | sine | radians | sin(0) → 0 |
cos | 1 | cosine | radians | cos(0) → 1 |
tan | 1 | tangent | radians | tan(0) → 0 |
asin | 1 | arcsine | |x| ≤ 1, radians | asin(1) → π/2 |
acos | 1 | arccosine | |x| ≤ 1, radians | acos(0) → π/2 |
atan | 1 | arctangent | any, radians | atan(1) → π/4 |
radians | 1 | degrees → radians | — | radians(180) → π |
degrees | 1 | radians → degrees | — | degrees(atan(1)) → 45 |
int | 1 | integer (decimal base) | exact integer, Int64 | int(45) → 45 |
bin | 1 | integer in binary base | exact integer, Int64 | bin(5) → 0b101 |
oct | 1 | integer in octal base | exact integer, Int64 | oct(8) → 0o10 |
hex | 1 | integer in hexadecimal base | exact integer, Int64 | hex(255) → 0xFF |
Integer functions and lanes
int, bin, oct and hex behave according to the lane they are called
on:
- On the exact integer lane, they return an exact Int64 with their base
representation (so
hex(255)→0xFF). - On the scalar (Double) lane, they return a strict integer value.
The lane itself — how lines enter it, its precedence and its overflow rules — is documented in Operators & logic and Numbers & integer bases.
Related
- Variables & functions — the approachable guide to naming values and calling functions.
- Percentages — strict phrase patterns.
- Numbers & integer bases — radix literals and display rules.