Function reference

A complete overview of every built-in function, operator and constant.


Free vs. Pro

Free

CategoryFunctions / features
Constantspi, e, inf, today, now
Operators+ - * / ^ %, < > <= >= == !=, and or not, ..
Trigonometrysin, cos, tan, asin, acos, atan, atan2
Mathsqrt, abs, exp, log, log10, log2, floor, ceil, round, min, max, pow, sign, clamp, lerp, mod
Stringsstr, len, print
Date & timedate, datetime, day, month, year, hour, minute, weekday, days, addmonths, addyears, monthstart, monthend, dformat
Proportionproportion
CSVcsv, csvwrite (manual load/save)
LanguageVariables, labels, line references (@n), comments, units

Pro

CategoryFunctions / features
Matricesdet, inv, transpose, trace, norm, eye, zeros, ones, size
Listslen, range, push, pop, first, last, sort, reverse, contains
Statisticssum, mean, median, std, variance, mode, percentile, quantile, corr, cov
Financepv, fv, pmt, nper, rate, npv, irr
Control flowfor / while loops with break / continue, if / elif / else
Chartsplot, scatter, bar, hist
Symbolic algebrasolve, simplify, factor
Differentiationdiff (symbolic and numeric)
Integrationintegrate (symbolic and numeric)
User-defined functionsf(x) = …, def name(…): (including recursion)
Classes & objectsclass Name(…):, methods, instances

Constants

NameValue / meaning
piπ ≈ 3.14159265358979…
eEuler's number ≈ 2.71828182845904…
infInfinity (∞)
todayToday's date (no time component)
nowCurrent date and time

Operators

Arithmetic

OperatorMeaningExample
+Addition3 + 47
-Subtraction10 - 37
*Multiplication2 * 510
/Division7 / 23.5
^Power2^8256
%Modulo10 % 31

Comparison

OperatorMeaning
<Less than
>Greater than
<=Less than or equal
>=Greater than or equal
==Equal
!=Not equal

Result: 1 (true) or 0 (false).

Logic

OperatorMeaningExample
andLogical andx > 0 and x < 10
orLogical orx < 0 or x > 10
notNegationnot (x == 0)

Range

SyntaxMeaning
a..bInteger range from a to b (inclusive)

Used in for loops and plot.


Trigonometry

All angles are in radians.

FunctionSyntaxResult
sinsin(x)Sine of x
coscos(x)Cosine of x
tantan(x)Tangent of x
asinasin(x)Arcsine, result in [−π/2, π/2]
acosacos(x)Arccosine, result in [0, π]
atanatan(x)Arctangent, result in (−π/2, π/2)
atan2atan2(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

FunctionSyntaxResult
sqrtsqrt(x)Square root of x
absabs(x)Absolute value
expexp(x)
loglog(x)Natural logarithm (base e)
log10log10(x)Logarithm base 10
log2log2(x)Logarithm base 2
floorfloor(x)Round down to nearest integer
ceilceil(x)Round up to nearest integer
roundround(x)Round to nearest integer (half away from zero)
minmin(a, b)The smaller of the two arguments
maxmax(a, b)The larger of the two arguments
powpow(x, n)x to the power of n (same as x^n)
signsign(x)Sign: −1, 0 or 1
clampclamp(x, min, max)Clamp x to the range [min, max]
lerplerp(a, b, t)Linear interpolation: a + t*(b−a); t=0 → a, t=1 → b
modmod(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)

FunctionSyntaxResult
diffdiff(expr, var)Symbolic derivative with respect to var
integrateintegrate(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)

FunctionSyntaxResult
diffdiff(expr, var, point)Numeric derivative at a point (central difference)
integrateintegrate(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)

FunctionSyntaxResult
solvesolve(expr, var)Roots / solutions
solvesolve(eq1, eq2, …, var1, var2, …)Solve a system of equations
simplifysimplify(expr)Simplify an expression
factorfactor(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
FunctionSyntaxResult
detdet(A)Determinant (square matrix)
invinv(A)Inverse (square matrix)
transposetranspose(A)Transpose
tracetrace(A)Trace (sum of diagonal elements)
normnorm(A)Frobenius norm; for a scalar: abs(x)
eyeeye(n)n×n identity matrix (up to 1000×1000)
zeroszeros(n) / zeros(r, c)Matrix of zeros
onesones(n) / ones(r, c)Matrix of ones
sizesize(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].

FunctionSyntaxResult
lenlen(list)Number of elements
rangerange(end)Integers 0 to end−1
rangerange(start, end)Integers start to end−1 (up to 100,000)
rangerange(start, end, step)With a custom step
pushpush(list, value)Append an element (returns a new list)
poppop(list)Remove the last element (returns a new list)
firstfirst(list)First element
lastlast(list)Last element
sortsort(list)Sorted ascending (returns a new list)
reversereverse(list)Reversed order (returns a new list)
containscontains(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.

FunctionSyntaxResult
sumsum(list) / sum(a, b, …)Sum of all values
meanmean(list) / mean(a, b, …)Arithmetic mean
medianmedian(list) / median(a, b, …)Median (middle value)
stdstd(list) / std(a, b, …)Sample standard deviation (÷ n−1)
variancevariance(list) / variance(a, b, …)Sample variance (÷ n−1)
modemode(list) / mode(a, b, …)Most frequent value
percentilepercentile(list, p)p-th percentile (p: 0–100), linear interpolation
quantilequantile(list, q)q-th quantile (q: 0–1), linear interpolation
corrcorr(xs, ys)Pearson correlation coefficient
covcov(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).

FunctionSyntaxResult
pvpv(rate, nper, pmt [, fv])Present value of an annuity; fv defaults to 0
fvfv(rate, nper, pmt [, pv])Future value of an annuity; pv defaults to 0
pmtpmt(rate, nper, pv [, fv])Periodic payment; fv defaults to 0
npernper(rate, pmt, pv [, fv])Number of periods; fv defaults to 0
raterate(nper, pmt, pv [, fv])Interest rate per period (Newton–Raphson, 300 iter.)
npvnpv(rate, cashflows)Net present value of future cashflows (list)
irrirr(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

FunctionSyntaxResult
strstr(value)Convert a number, matrix or date to text
lenlen(text)Length of the string (number of characters)
printprint(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

FunctionSyntaxResult
datedate(year, month, day)Date value
datetimedatetime(year, month, day, hour, minute)Date with time
datetimedatetime(year, month, day, hour, minute, second)Date with seconds

Extractors

FunctionSyntaxResult
dayday(d)Day (1–31)
monthmonth(d)Month (1–12)
yearyear(d)Year (e.g. 2025)
hourhour(d)Hour (0–23)
minuteminute(d)Minute (0–59)
weekdayweekday(d)Weekday: 1 = Monday … 7 = Sunday (ISO 8601)

Arithmetic & formatting

FunctionSyntaxResult
daysdays(d1, d2)Difference in days (d1 − d2)
addmonthsaddmonths(d, n)Add n months (day clamped to month end if needed)
addyearsaddyears(d, n)Add n years (Feb 29 → Feb 28 in non-leap years)
monthstartmonthstart(d)First day of the month
monthendmonthend(d)Last day of the month
dformatdformat(d)Default format (e.g. "13.06.2026")
dformatdformat(d, "pattern")Custom format (see placeholders below)
-d1 - d2Difference in days (shorthand)

Placeholders for dformat:

PlaceholderMeaning
yyyyFour-digit year
MMTwo-digit month (01–12)
ddTwo-digit day (01–31)
HHTwo-digit hour (00–23)
mmTwo-digit minute (00–59)
ssTwo-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")
ParameterMeaningDefault
exprExpression in x
from..tox range (range syntax)−2π .. 2π
from, tox range (legacy syntax, 3 arguments)−2π, 2π
yFrom..yToFix the y axisautomatic
stepsNumber of sample points (2 – 10,000)300
"…" stringsChart 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, …

ParameterMeaningDefault
valuesList of bar heights
xsExplicit x positions for the bars0, 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.

ParameterMeaningDefault
dataList of values to bin
binsNumber 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
FunctionMeaning
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

FunctionSyntaxResult
proportionproportion(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

Short form (single line)

f(x) = x^2 + 2*x

Long form with def

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

Comments

// 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