A complete overview of every built-in function, operator and constant.
Free vs. Pro
Free
| Category | Functions / features |
|---|
| Constants | pi, e, inf, today, now |
| Operators | + - * / ^ %, < > <= >= == !=, and or not, .. |
| Trigonometry | sin, cos, tan, asin, acos, atan, atan2 |
| Math | sqrt, abs, exp, log, log10, log2, floor, ceil, round, min, max, pow, sign, clamp, lerp, mod |
| Strings | str, len, print |
| Date & time | date, datetime, day, month, year, hour, minute, weekday, days, addmonths, addyears, monthstart, monthend, dformat |
| Proportion | proportion |
| CSV | csv, csvwrite (manual load/save) |
| Language | Variables, labels, line references (@n), comments, units |
Pro
| Category | Functions / features |
|---|
| Matrices | det, inv, transpose, trace, norm, eye, zeros, ones, size |
| Lists | len, range, push, pop, first, last, sort, reverse, contains |
| Statistics | sum, mean, median, std, variance, mode, percentile, quantile, corr, cov |
| Finance | pv, fv, pmt, nper, rate, npv, irr |
| Control flow | for / while loops with break / continue, if / elif / else |
| Charts | plot, scatter, bar, hist |
| Symbolic algebra | solve, simplify, factor |
| Differentiation | diff (symbolic and numeric) |
| Integration | integrate (symbolic and numeric) |
| User-defined functions | f(x) = …, def name(…): (including recursion) |
| Classes & objects | class Name(…):, methods, instances |
Constants
| Name | Value / meaning |
|---|
pi | π ≈ 3.14159265358979… |
e | Euler's number ≈ 2.71828182845904… |
inf | Infinity (∞) |
today | Today's date (no time component) |
now | Current date and time |
Operators
Arithmetic
| Operator | Meaning | Example |
|---|
+ | Addition | 3 + 4 → 7 |
- | Subtraction | 10 - 3 → 7 |
* | Multiplication | 2 * 5 → 10 |
/ | Division | 7 / 2 → 3.5 |
^ | Power | 2^8 → 256 |
% | Modulo | 10 % 3 → 1 |
Comparison
| Operator | Meaning |
|---|
< | Less than |
> | Greater than |
<= | Less than or equal |
>= | Greater than or equal |
== | Equal |
!= | Not equal |
Result: 1 (true) or 0 (false).
Logic
| Operator | Meaning | Example |
|---|
and | Logical and | x > 0 and x < 10 |
or | Logical or | x < 0 or x > 10 |
not | Negation | not (x == 0) |
Range
| Syntax | Meaning |
|---|
a..b | Integer range from a to b (inclusive) |
Used in for loops and plot.
Trigonometry
All angles are in radians.
| Function | Syntax | Result |
|---|
sin | sin(x) | Sine of x |
cos | cos(x) | Cosine of x |
tan | tan(x) | Tangent of x |
asin | asin(x) | Arcsine, result in [−π/2, π/2] |
acos | acos(x) | Arccosine, result in [0, π] |
atan | atan(x) | Arctangent, result in (−π/2, π/2) |
atan2 | atan2(y, x) | Arctangent of y/x (preserves the quadrant) |
sin(pi / 2) → 1
cos(0) → 1
atan2(1, 1) → 0.7853… (= π/4)
Basic math functions
| Function | Syntax | Result |
|---|
sqrt | sqrt(x) | Square root of x |
abs | abs(x) | Absolute value |
exp | exp(x) | eˣ |
log | log(x) | Natural logarithm (base e) |
log10 | log10(x) | Logarithm base 10 |
log2 | log2(x) | Logarithm base 2 |
floor | floor(x) | Round down to nearest integer |
ceil | ceil(x) | Round up to nearest integer |
round | round(x) | Round to nearest integer (half away from zero) |
min | min(a, b) | The smaller of the two arguments |
max | max(a, b) | The larger of the two arguments |
pow | pow(x, n) | x to the power of n (same as x^n) |
sign | sign(x) | Sign: −1, 0 or 1 |
clamp | clamp(x, min, max) | Clamp x to the range [min, max] |
lerp | lerp(a, b, t) | Linear interpolation: a + t*(b−a); t=0 → a, t=1 → b |
mod | mod(a, b) | Remainder of a÷b (same as a % b, but as a function) |
sqrt(144) → 12
log(e) → 1
log10(1000) → 3
floor(3.7) → 3
ceil(3.2) → 4
sign(-5) → -1
clamp(15, 0, 10) → 10
clamp(-3, 0, 10) → 0
lerp(0, 100, 0.25) → 25
mod(17, 5) → 2
Calculus
Symbolic (2 arguments)
| Function | Syntax | Result |
|---|
diff | diff(expr, var) | Symbolic derivative with respect to var |
integrate | integrate(expr, var) | Symbolic indefinite integral |
diff(x^3, x) → 3x²
diff(sin(x), x) → cos(x)
integrate(x^2, x) → x³/3
integrate(sin(x), x) → −cos(x)
Numeric (3 or 4 arguments)
| Function | Syntax | Result |
|---|
diff | diff(expr, var, point) | Numeric derivative at a point (central difference) |
integrate | integrate(expr, var, a, b) | Numeric integral from a to b (Simpson's rule) |
diff(x^2, x, 3) → 6
integrate(x^2, x, 0, 3) → 9
Symbolic algebra (CAS)
| Function | Syntax | Result |
|---|
solve | solve(expr, var) | Roots / solutions |
solve | solve(eq1, eq2, …, var1, var2, …) | Solve a system of equations |
simplify | simplify(expr) | Simplify an expression |
factor | factor(expr) | Factor an expression |
solve(x^2 - 4, x) → x = -2, x = 2
solve(x^2 + 2*x + 1 == 0, x) → x = -1
solve(x + y == 3, x - y == 1, x, y) → x = 2, y = 1
simplify(x^2 / x) → x
factor(x^2 - 4) → (x − 2)(x + 2)
factor(x^2 + 2*x + 1) → (x + 1)²
Matrices
Matrix literal syntax: [row1; row2; …], values separated by commas.
A = [1, 2; 3, 4] // 2×2 matrix
v = [1, 2, 3] // row vector
| Function | Syntax | Result |
|---|
det | det(A) | Determinant (square matrix) |
inv | inv(A) | Inverse (square matrix) |
transpose | transpose(A) | Transpose |
trace | trace(A) | Trace (sum of diagonal elements) |
norm | norm(A) | Frobenius norm; for a scalar: abs(x) |
eye | eye(n) | n×n identity matrix (up to 1000×1000) |
zeros | zeros(n) / zeros(r, c) | Matrix of zeros |
ones | ones(n) / ones(r, c) | Matrix of ones |
size | size(A) / size(A, dim) | [rows, cols]; dim=1 → rows, dim=2 → cols |
det([1, 2; 3, 4]) → -2
inv([1, 2; 3, 4]) → [[-2, 1], [1.5, -0.5]]
transpose([1, 2; 3, 4]) → [[1, 3], [2, 4]]
trace([1, 2; 3, 4]) → 5
eye(3) → [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
zeros(2, 3) → [[0, 0, 0], [0, 0, 0]]
size([1, 2; 3, 4]) → [2, 2]
size([1, 2; 3, 4], 1) → 2
Lists & arrays
Lists are internally 1×n matrices: [1, 2, 3].
| Function | Syntax | Result |
|---|
len | len(list) | Number of elements |
range | range(end) | Integers 0 to end−1 |
range | range(start, end) | Integers start to end−1 (up to 100,000) |
range | range(start, end, step) | With a custom step |
push | push(list, value) | Append an element (returns a new list) |
pop | pop(list) | Remove the last element (returns a new list) |
first | first(list) | First element |
last | last(list) | Last element |
sort | sort(list) | Sorted ascending (returns a new list) |
reverse | reverse(list) | Reversed order (returns a new list) |
contains | contains(list, value) | 1 if present, otherwise 0 |
len([10, 20, 30]) → 3
range(5) → [0, 1, 2, 3, 4]
range(2, 6) → [2, 3, 4, 5]
range(0, 10, 2) → [0, 2, 4, 6, 8]
push([1, 2], 3) → [1, 2, 3]
pop([1, 2, 3]) → [1, 2]
first([5, 6, 7]) → 5
last([5, 6, 7]) → 7
sort([3, 1, 2]) → [1, 2, 3]
reverse([1, 2, 3]) → [3, 2, 1]
contains([1, 2, 3], 2) → 1
Statistics
All statistics functions accept either a list or comma-separated values.
| Function | Syntax | Result |
|---|
sum | sum(list) / sum(a, b, …) | Sum of all values |
mean | mean(list) / mean(a, b, …) | Arithmetic mean |
median | median(list) / median(a, b, …) | Median (middle value) |
std | std(list) / std(a, b, …) | Sample standard deviation (÷ n−1) |
variance | variance(list) / variance(a, b, …) | Sample variance (÷ n−1) |
mode | mode(list) / mode(a, b, …) | Most frequent value |
percentile | percentile(list, p) | p-th percentile (p: 0–100), linear interpolation |
quantile | quantile(list, q) | q-th quantile (q: 0–1), linear interpolation |
corr | corr(xs, ys) | Pearson correlation coefficient |
cov | cov(xs, ys) | Sample covariance (÷ n−1) |
sum([1, 2, 3, 4]) → 10
mean(2, 4, 6) → 4
median([1, 3, 5, 7]) → 4
std(2, 4, 4, 4, 5, 5, 7, 9) → 2
variance([2, 4, 4, 4, 5, 5, 7, 9]) → 4
mode([1, 2, 2, 3]) → 2
percentile([1, 2, 3, 4, 5], 75) → 4
quantile([1, 2, 3, 4, 5], 0.5) → 3
xs = [1, 2, 3, 4, 5]
ys = [2, 4, 5, 4, 5]
corr(xs, ys) → 0.9079
cov(xs, ys) → 1.75
Finance
All finance functions use standard Excel-compatible sign conventions: inflows positive, outflows negative. rate as a decimal (5 % = 0.05).
| Function | Syntax | Result |
|---|
pv | pv(rate, nper, pmt [, fv]) | Present value of an annuity; fv defaults to 0 |
fv | fv(rate, nper, pmt [, pv]) | Future value of an annuity; pv defaults to 0 |
pmt | pmt(rate, nper, pv [, fv]) | Periodic payment; fv defaults to 0 |
nper | nper(rate, pmt, pv [, fv]) | Number of periods; fv defaults to 0 |
rate | rate(nper, pmt, pv [, fv]) | Interest rate per period (Newton–Raphson, 300 iter.) |
npv | npv(rate, cashflows) | Net present value of future cashflows (list) |
irr | irr(cashflows) | Internal rate of return (Newton–Raphson, 300 iter.) |
// Monthly payment on a 200 000 € loan, 5 % p.a. over 20 years
rate_m = 0.05 / 12
pmt(rate_m, 240, 200000) → -1319.91
// Future value of 200 €/month over 10 years at 4 % p.a.
fv(0.04 / 12, 120, -200) → 29 411.03
// Present value of receiving 1 000 €/year for 5 years at 6 %
pv(0.06, 5, 1000) → 4212.36
// IRR of a project: invest 1 000 €, receive 400 € each of 3 years
irr([-1000, 400, 400, 400]) → 0.0974 // ≈ 9.74 %
Strings
| Function | Syntax | Result |
|---|
str | str(value) | Convert a number, matrix or date to text |
len | len(text) | Length of the string (number of characters) |
print | print(value) | Print value or string in the result column |
str(42) → "42"
str([1, 2, 3]) → "[[1, 2, 3]]"
len("Hello") → 5
print("Result:")
Date & time
Constructors
| Function | Syntax | Result |
|---|
date | date(year, month, day) | Date value |
datetime | datetime(year, month, day, hour, minute) | Date with time |
datetime | datetime(year, month, day, hour, minute, second) | Date with seconds |
| Function | Syntax | Result |
|---|
day | day(d) | Day (1–31) |
month | month(d) | Month (1–12) |
year | year(d) | Year (e.g. 2025) |
hour | hour(d) | Hour (0–23) |
minute | minute(d) | Minute (0–59) |
weekday | weekday(d) | Weekday: 1 = Monday … 7 = Sunday (ISO 8601) |
| Function | Syntax | Result |
|---|
days | days(d1, d2) | Difference in days (d1 − d2) |
addmonths | addmonths(d, n) | Add n months (day clamped to month end if needed) |
addyears | addyears(d, n) | Add n years (Feb 29 → Feb 28 in non-leap years) |
monthstart | monthstart(d) | First day of the month |
monthend | monthend(d) | Last day of the month |
dformat | dformat(d) | Default format (e.g. "13.06.2026") |
dformat | dformat(d, "pattern") | Custom format (see placeholders below) |
- | d1 - d2 | Difference in days (shorthand) |
Placeholders for dformat:
| Placeholder | Meaning |
|---|
yyyy | Four-digit year |
MM | Two-digit month (01–12) |
dd | Two-digit day (01–31) |
HH | Two-digit hour (00–23) |
mm | Two-digit minute (00–59) |
ss | Two-digit second (00–59) |
d = date(2026, 6, 13)
day(d) → 13
weekday(d) → 6 // Saturday
days(date(2026, 12, 31), d) → 201
dformat(d, "dd.MM.yyyy") → "13.06.2026"
addmonths(d, 3) → 2026-09-13
addmonths(date(2026, 1, 31), 1) → 2026-02-28 // clamped to Feb end
addyears(d, 1) → 2027-06-13
monthstart(d) → 2026-06-01
monthend(d) → 2026-06-30
datetime(2026, 6, 13, 14, 30)
today → current date
now → current date and time
Charts
plot — line chart
plot(expr)
plot(expr, from..to)
plot(expr, from, to)
plot(expr, from..to, yFrom..yTo)
plot(expr, from..to, yFrom..yTo, steps)
plot(expr, ..., "title", "x axis", "y axis")
| Parameter | Meaning | Default |
|---|
expr | Expression in x | — |
from..to | x range (range syntax) | −2π .. 2π |
from, to | x range (legacy syntax, 3 arguments) | −2π, 2π |
yFrom..yTo | Fix the y axis | automatic |
steps | Number of sample points (2 – 10,000) | 300 |
"…" strings | Chart title, x-axis and y-axis label (in order) | none |
String arguments may appear in any position; they are assigned in order as title, x-axis label and y-axis label.
plot(sin(x))
plot(x^2, -5..5)
plot(x^3, -10, 10)
plot(sin(x), -pi..pi, -1..1, 500)
plot(sin(x), "Oscillation", "time t", "amplitude")
scatter — point cloud
scatter(xs, ys)
Both arguments must be lists or vectors of equal length.
scatter([1, 2, 3, 4], [1, 4, 9, 16])
bar — bar chart
bar(values)
bar(values, xs)
Draws a bar chart. values is a list of bar heights. The optional xs argument provides explicit x positions (must have the same length as values); without it the bars are numbered 0, 1, 2, …
| Parameter | Meaning | Default |
|---|
values | List of bar heights | — |
xs | Explicit x positions for the bars | 0, 1, 2, … |
bar([12, 7, 19, 5])
sales = [4200, 5100, 3800, 6300]
bar(sales)
bar([10, 20, 30], [2020, 2021, 2022])
hist — histogram
hist(data)
hist(data, bins)
Bins the data into a frequency histogram and draws it. Bars touch to emphasise the continuous distribution.
| Parameter | Meaning | Default |
|---|
data | List of values to bin | — |
bins | Number of bins (2 – 200) | 10 |
data = [2, 5, 3, 8, 5, 7, 5, 3, 4, 6, 7, 5]
hist(data)
hist(data, 5)
Export: every chart has overlay buttons for SVG, PNG and CSV.
CSV import / export
CSV files are read and written manually — never automatically on every keystroke. A load/save button appears in the result row of any line that uses csv(…) or csvwrite(…).
total = csv("sales") // column 1 of the picked file
q2 = csv("sales", 2) // column 2 (1-based)
rev = csv("sales", "revenue") // column by header name
csvwrite([1, 2, 3], "out") // shows a save button
| Function | Meaning |
|---|
csv("name") | First column as a list |
csv("name", n) | Column n (1-based) |
csv("name", "header") | Column by header name |
csvwrite(data, "name") | Export a list/matrix as CSV (manual save button) |
What the name is for
The string in csv("name") is a display name / key, not a file path. Clicking the load button opens a native file dialog; the name only labels the import. It does three things:
1. Tells imports apart. Several independent sources can live in one document, each with its own load button and its own file: `` revenue = csv("revenue") costs = csv("costs") ` 2. Load once, use many columns. Every call with the same name shares the one loaded table, so you pick the file only once: ` month = csv("sales", 1) units = csv("sales", 2) price = csv("sales", "price") `` 3. Drives the load indicator. The button shows, per name, whether data is already in memory (a check mark) or still needs loading.
Loaded data lives in memory only — after restarting the app you load it again, and the name is the stable label that reconnects a formula to its source. The delimiter (;, tab or ,) and a header row are detected automatically; with ;/tab a decimal comma is accepted.
Proportion
| Function | Syntax | Result |
|---|
proportion | proportion(a, b, c) | a · c / b |
Solves: a : b = ? : c
proportion(3, 4, 8) → 6 // 3:4 = 6:8
Control flow (user functions)
For loop
for i in 1..n:
…
for i in list:
…
Maximum 10,000 iterations. Integer range: at most 10,000 steps.
Use break to exit the loop immediately, continue to skip ahead to the next iteration:
for i in 1..10:
if i == 5:
break
if i % 2 == 0:
continue
…
While loop
while condition:
…
break and continue work the same way as in for.
If / elif / else
if condition:
…
elif another_condition:
…
elif yet_another:
…
else:
…
Any number of elif branches are allowed; else is optional.
Return
return value
Recursion
Maximum 100 levels of call depth.
User-defined functions
f(x) = x^2 + 2*x
def name(param1, param2, optParam = defaultValue):
…
return result
def factorial(n):
s = 1
for i in 1..n:
s = s * i
return s
factorial(6) → 720
Classes
class Name(param1, param2, …):
def method():
return …
class Circle(r):
def area():
return pi * r^2
def circumference():
return 2 * pi * r
c = Circle(5)
c.area() → 78.5398…
c.circumference() → 31.4159…
Miscellaneous
Line references
@1, @2, … — refer to the result of that line.
5 * 3 → 15
@1 + 10 → 25
// single-line comment
# also a comment
Labels
VAT: 0.19 * 100 → VAT: 19
Mathlib import
import "file.dplylib"
Debug / print
print(x) // prints x in the result column