Mathematical function reference
Use the built-in functions below as a starting reference. Arguments must satisfy each function’s domain.
Expressions; Examples drawer and Quick guide

Try it step by step
- Choose the function family you need.
- Enter parentheses around arguments and brackets around lists.
- For less common names, use the supported operator-name notation shown by examples.
- Check the result message when an argument is outside the domain.
Examples to try
Each card is one input. For definitions, enter the cards in order. Formula-only cards belong in the tool described above.
The average is 4.
The determinant is −2.
Options explained
Function dictionary
Signatures show literal input syntax. Examples use radians. Optional arguments show their defaults; list and work limits still apply.
abs
sqrt
sqrt(x)x: nonnegative for real output; complex inputs use the supported principal branch.
Result: 3
Learn moreexp
ln
log
sin
sin(x)x: angle in the selected mode. Examples use radians. Reciprocal functions are undefined where their denominator is zero.
Result: 0
Learn morecos
cos(x)x: angle in the selected mode. Examples use radians. Reciprocal functions are undefined where their denominator is zero.
Result: 1
Learn moretan
tan(x)x: angle in the selected mode. Examples use radians. Reciprocal functions are undefined where their denominator is zero.
Result: 0
Learn moresec
sec(x)x: angle in the selected mode. Examples use radians. Reciprocal functions are undefined where their denominator is zero.
Result: 1
Learn morecsc
csc(x)x: angle in the selected mode. Examples use radians. Reciprocal functions are undefined where their denominator is zero.
Result: 1
Learn morecot
cot(x)x: angle in the selected mode. Examples use radians. Reciprocal functions are undefined where their denominator is zero.
Result: 1
Learn morearcsin
arccos
arctan
sinh
sinh(x)Hyperbolic functions use real numeric arguments, independent of angle mode. csch/coth exclude zero; arccosh needs x ≥ 1; arctanh needs −1 < x < 1.
Result: 0
Learn morecosh
cosh(x)Hyperbolic functions use real numeric arguments, independent of angle mode. csch/coth exclude zero; arccosh needs x ≥ 1; arctanh needs −1 < x < 1.
Result: 1
Learn moretanh
tanh(x)Hyperbolic functions use real numeric arguments, independent of angle mode. csch/coth exclude zero; arccosh needs x ≥ 1; arctanh needs −1 < x < 1.
Result: 0
Learn moresech
sech(x)Hyperbolic functions use real numeric arguments, independent of angle mode. csch/coth exclude zero; arccosh needs x ≥ 1; arctanh needs −1 < x < 1.
Result: 1
Learn morecsch
csch(x)Hyperbolic functions use real numeric arguments, independent of angle mode. csch/coth exclude zero; arccosh needs x ≥ 1; arctanh needs −1 < x < 1.
Result: approximately 0.850918
Learn morecoth
coth(x)Hyperbolic functions use real numeric arguments, independent of angle mode. csch/coth exclude zero; arccosh needs x ≥ 1; arctanh needs −1 < x < 1.
Result: approximately 1.313035
Learn morearcsinh
arcsinh(x)Hyperbolic functions use real numeric arguments, independent of angle mode. csch/coth exclude zero; arccosh needs x ≥ 1; arctanh needs −1 < x < 1.
Result: 0
Learn morearccosh
arccosh(x)Hyperbolic functions use real numeric arguments, independent of angle mode. csch/coth exclude zero; arccosh needs x ≥ 1; arctanh needs −1 < x < 1.
Result: 0
Learn morearctanh
arctanh(x)Hyperbolic functions use real numeric arguments, independent of angle mode. csch/coth exclude zero; arccosh needs x ≥ 1; arctanh needs −1 < x < 1.
Result: 0
Learn morefloor
floor(x)x: a finite real number. floor rounds down, ceil up, round to the nearest integer; sign gives −1, 0 or 1.
Result: 2
Learn moreceil
ceil(x)x: a finite real number. floor rounds down, ceil up, round to the nearest integer; sign gives −1, 0 or 1.
Result: 3
Learn moreround
round(x)x: a finite real number. floor rounds down, ceil up, round to the nearest integer; sign gives −1, 0 or 1.
Result: 3
Learn moresign
sign(x)x: a finite real number. floor rounds down, ceil up, round to the nearest integer; sign gives −1, 0 or 1.
Result: −1
Learn moremod
mod(a,b)a: dividend; b: nonzero divisor. The result uses the divisor-sign modulo convention.
Result: 1
Learn morefactorial
n!For integer factorials use nonnegative n. Values beyond the finite numerical range are undefined.
Result: 120
Learn moregcd
lcm
mean
mean(L)L: a finite numeric list. variance/stdev use sample normalization (at least two values); varp/stdevp use population normalization. mad is the mean absolute deviation from the mean.
Result: 4
Learn moremedian
median(L)L: a finite numeric list. variance/stdev use sample normalization (at least two values); varp/stdevp use population normalization. mad is the mean absolute deviation from the mean.
Result: 4
Learn moretotal
total(L)L: a finite numeric list. variance/stdev use sample normalization (at least two values); varp/stdevp use population normalization. mad is the mean absolute deviation from the mean.
Result: 12
Learn morecount
count(L)L: a finite numeric list. variance/stdev use sample normalization (at least two values); varp/stdevp use population normalization. mad is the mean absolute deviation from the mean.
Result: 3
Learn morevariance
variance(L)L: a finite numeric list. variance/stdev use sample normalization (at least two values); varp/stdevp use population normalization. mad is the mean absolute deviation from the mean.
Result: 4
Learn morevarp
varp(L)L: a finite numeric list. variance/stdev use sample normalization (at least two values); varp/stdevp use population normalization. mad is the mean absolute deviation from the mean.
Result: 8/3
Learn morestdev
stdev(L)L: a finite numeric list. variance/stdev use sample normalization (at least two values); varp/stdevp use population normalization. mad is the mean absolute deviation from the mean.
Result: 2
Learn morestdevp
stdevp(L)L: a finite numeric list. variance/stdev use sample normalization (at least two values); varp/stdevp use population normalization. mad is the mean absolute deviation from the mean.
Result: approximately 1.632993
Learn moremad
mad(L)L: a finite numeric list. variance/stdev use sample normalization (at least two values); varp/stdevp use population normalization. mad is the mean absolute deviation from the mean.
Result: 4/3
Learn morequantile
quantile(L,p)L: nonempty finite numeric list; p in [0,1]. Uses type-7 linear interpolation.
Result: 2.5
Learn morepercentile
quartile
quartile(L,k)L: finite numeric list; k is an integer from 0 to 4 (minimum through maximum).
Result: 2
Learn morestats
stats(L)L: nonempty finite numeric list; returns minimum, Q1, median, Q3, maximum.
Result: [0,1,2,3,4]
Learn morecov
cov(X,Y)X and Y: paired finite lists of equal length. Sample covariance needs two pairs; correlations need nonzero spread. Spearman correlates ranks.
Result: 2
Learn morecovp
covp(X,Y)X and Y: paired finite lists of equal length. Sample covariance needs two pairs; correlations need nonzero spread. Spearman correlates ranks.
Result: 1
Learn morecorr
corr(X,Y)X and Y: paired finite lists of equal length. Sample covariance needs two pairs; correlations need nonzero spread. Spearman correlates ranks.
Result: 1
Learn morespearman
spearman(X,Y)X and Y: paired finite lists of equal length. Sample covariance needs two pairs; correlations need nonzero spread. Spearman correlates ranks.
Result: 1
Learn morerandom
random(count,seed)count: nonnegative integer; seed: optional finite number. Returns values in [0,1). random() returns one scalar; seeded calls repeat exactly.
Result: A reproducible three-value list
Learn moreshuffle
shuffle(L,seed)L: list; optional finite seed. Reorders entries without removing any.
Result: A reproducible permutation of [1,2,3]
Learn moresample
sample(L,count,seed)L: nonempty list; count: nonnegative integer. Samples with replacement; seed is optional.
Result: Three entries, each 1 or 2
Learn morerepeat
repeat(L,counts)L and counts: matching lists; each count is a nonnegative integer.
Result: [2,2,4]
Learn morecomplex
real
real(z)z: complex value. arg returns its angle in the selected angle mode; examples use radians.
Result: 1
Learn moreimag
imag(z)z: complex value. arg returns its angle in the selected angle mode; examples use radians.
Result: 2
Learn moreconj
conj(z)z: complex value. arg returns its angle in the selected angle mode; examples use radians.
Result: 1 − 2i
Learn morearg
arg(z)z: complex value. arg returns its angle in the selected angle mode; examples use radians.
Result: approximately 1.107149 radians
Learn morematrix
matrix(rows)rows: a rectangular nested numeric list; at most 16 by 16.
Result: A 2 × 2 explicit matrix
Learn moredet
det(A)A: explicit matrix. det/inverse/trace need a square matrix; inverse also needs a nonsingular matrix.
Result: −2
Learn moreinverse
inverse(A)A: explicit matrix. det/inverse/trace need a square matrix; inverse also needs a nonsingular matrix.
Result: [[-2,1],[1.5,-0.5]]
Learn moretranspose
transpose(A)A: explicit matrix. det/inverse/trace need a square matrix; inverse also needs a nonsingular matrix.
Result: [[1,3],[2,4]]
Learn morerref
rref(A)A: explicit matrix. det/inverse/trace need a square matrix; inverse also needs a nonsingular matrix.
Result: [[1,0],[0,1]]
Learn moretrace
trace(A)A: explicit matrix. det/inverse/trace need a square matrix; inverse also needs a nonsingular matrix.
Result: 5
Learn moreidentity
identity(n)n: positive integer at most 16; creates an n × n identity matrix.
Result: [[1,0],[0,1]]
Learn morematmul
matmul(A,B)A and B: matrices whose inner dimensions agree; this is a matrix product.
Result: [[1,2],[3,4]]
Learn morenormaldist
normaldist(mean=0,sd=1)sd > 0. Parameters are optional.
Result: A distribution object; use its methods below.
Learn moreuniformdist
uniformdist(lower=0,upper=1)upper > lower. Parameters are optional.
Result: A distribution object; use its methods below.
Learn moretdist
tdist(df)Positive degrees of freedom, up to 1,000,000.
Result: A distribution object; use its methods below.
Learn morechisqdist
chisqdist(df)Positive degrees of freedom, up to 1,000,000.
Result: A distribution object; use its methods below.
Learn morebinomialdist
binomialdist(trials,p=0.5)Integer trials from 0 to 1,000,000; probability p in [0,1].
Result: A distribution object; use its methods below.
Learn morepoissondist
poissondist(mean)Mean from 0 to 1,000,000.
Result: A distribution object; use its methods below.
Learn moreexponentialdist
exponentialdist(rate)Positive rate up to 1,000,000.
Result: A distribution object; use its methods below.
Learn moregeodist
geodist(p)0 < p ≤ 1; counts trials until the first success, starting at 1.
Result: A distribution object; use its methods below.
Learn mored.pdf(x)d: distribution; x: value. Returns density for continuous distributions or probability mass for discrete ones.
Result: Then d.pdf(0) ≈ 0.398942
Learn morecdf
d.cdf(x) or d.cdf(lower,upper)Cumulative probability through x, or interval probability between the supplied bounds.
Result: Then d.cdf(0.5) = 0.5
Learn moreinversecdf
d.inversecdf(p)p: probability in [0,1]. Infinite endpoint quantiles may be undefined in finite output.
Result: Then d.inversecdf(0.5) = 0
Learn moredistribution sampling
d.random(count,seed)count: nonnegative integer; seed: optional finite number. Keep the seed to reproduce the sample.
Result: Then d.random(3,42) gives three integers between 0 and 10
Learn morehistogram
histogram(L,width)L: finite values; width: optional positive bin width. At most 100 bins.
Result: Two occupied bins with two observations each
Learn moreboxplot
boxplot(L,offset,height)L: finite values; offset: vertical center (default 1); height: positive box height (default 1). Uses type-7 quartiles and min–max whiskers.
Result: Median 2, Q1 1, Q3 3; box centered at y = 2 with height 1
Learn moredotplot
dotplot(L,width)L: up to 2,000 finite values; width: optional positive grouping width.
Result: Two stacked dots at 1 and one at 2
Learn more