Reference

Built-in functions

Search and filter the built-in functions documented for the Sun interpreter.

01

Function catalog

This inventory follows the runtime dispatch and parallel purity lists. Signatures distinguish interpreter support, native LLVM lowering, and effects that require a capable runtime host.

54 functions

NameSignatureDescriptionAvailability
sqrtsqrt(x)Element-wise square root of a scalar, boolean, or matrix.
InterpreterLLVM
sinsin(x)Element-wise sine using real f64 semantics.
InterpreterLLVM
coscos(x)Element-wise cosine using real f64 semantics.
InterpreterLLVM
tantan(x)Element-wise tangent of a scalar, boolean, or matrix.
Interpreter
absabs(x)Element-wise absolute value.
Interpreter
accumarrayaccumarray(subs, values)Sums scalar or vector values into a dense 1D or 2D matrix using positive 1-based subscripts.
Interpreter
acosacos(x)Element-wise inverse cosine in radians for real or complex scalars and real matrices.
Interpreter
acosdacosd(x)Element-wise inverse cosine in degrees for real or complex scalars and real matrices.
Interpreter
acoshacosh(x)Element-wise inverse hyperbolic cosine for real or complex scalars and real matrices.
Interpreter
acotacot(x)Element-wise inverse cotangent in radians for real or complex scalars and real matrices.
Interpreter
acotdacotd(x)Element-wise inverse cotangent in degrees for real or complex scalars and real matrices.
Interpreter
acothacoth(x)Element-wise inverse hyperbolic cotangent for real or complex scalars and real matrices.
Interpreter
acscacsc(x)Element-wise inverse cosecant in radians for real or complex scalars and real matrices.
Interpreter
acscdacscd(x)Element-wise inverse cosecant in degrees for real or complex scalars and real matrices.
Interpreter
acschacsch(x)Element-wise inverse hyperbolic cosecant for real or complex scalars and real matrices.
Interpreter
allall(x)Returns one boolean indicating whether every scalar or matrix element is nonzero.
Interpreter
allbetweenallbetween(x, lower, upper)Returns whether every real element lies in a closed interval with scalar bounds.
Interpreter
allfiniteallfinite(x)Returns whether every real or complex component is finite.
Interpreter
classclass(value)Returns the runtime class name of a value.
Interpreter
isaisa(value, className)Tests an exact class name or the numeric, float, and integer categories.
Interpreter
doubledouble(value)Preserves double values and converts logical scalars to 0 or 1.
Interpreter
expexp(x)Element-wise exponential.
InterpreterLLVM
loglog(x)Element-wise natural logarithm.
InterpreterLLVM
sumsum(x)Reduces all matrix elements to one scalar; sum([]) is 0.
Interpreter
meanmean(x)Arithmetic mean of all elements; mean([]) is NaN.
Interpreter
minmin(x) | min(a, b)Reduces one value or compares two values element by element.
Interpreter
maxmax(x) | max(a, b)Reduces one value or compares two values element by element.
Interpreter
zeroszeros() | zeros(n) | zeros(r, c) | zeros([r, c])Creates a zero-filled matrix with checked dimensions.
Interpreter
onesones() | ones(n) | ones(r, c) | ones([r, c])Creates a one-filled matrix with checked dimensions.
Interpreter
eyeeye() | eye(n) | eye(r, c) | eye([r, c])Creates a rectangular identity matrix.
Interpreter
transposetranspose(A)Returns the transpose of a numeric matrix.
Interpreter
detdet(A)Computes the determinant of a square matrix.
Interpreter
invinv(A)Inverts a nonsingular square matrix.
Interpreter
solvesolve(A, B)Solves the dense linear system A * X = B.
Interpreter
sizesize(x)Returns [rows, columns] for a scalar, boolean, or matrix.
Interpreter
numelnumel(x)Returns the total number of elements.
Interpreter
isemptyisempty(x)Returns true when a value has no matrix elements.
Interpreter
dispdisp(value)Writes one value to the active runtime host.
InterpreterLLVM
pausepause() | pause(seconds) | pause(state)Waits interactively, sleeps, or changes the session pause state.
InterpreterHost
errorerror(message) | error(identifier, message)Raises a catchable Sun runtime exception.
Interpreter
rethrowrethrow(exception)Raises an existing exception without changing its identity.
Interpreter
readmatrixreadmatrix(filename)Reads a headerless UTF-8 numeric CSV file into a matrix.
InterpreterHost
writematrixwritematrix(value, filename)Atomically writes a numeric scalar or matrix as CSV.
InterpreterHost
plotplot(x, y)Creates a 2D curve figure in a graphical host.
InterpreterHost
plot3plot3(x, y, z)Creates one or more 3D curves.
InterpreterHost
surfsurf(Z) | surf(x, y, Z) | surf(X, Y, Z)Creates a triangulated 3D surface.
InterpreterHost
titletitle(text)Sets the active figure title.
InterpreterHost
xlabelxlabel(text)Sets the active figure x-axis label.
InterpreterHost
ylabelylabel(text)Sets the active figure y-axis label.
InterpreterHost
zlabelzlabel(text)Sets the z-axis label on a 3D figure.
InterpreterHost
legendlegend(labels...) | legend("on" | "off")Labels curves or changes legend visibility.
InterpreterHost
gridgrid() | grid(flag)Toggles or explicitly configures the figure grid.
InterpreterHost
axisaxis("auto") | axis(limits)Sets 2D four-value or 3D six-value finite bounds.
InterpreterHost
clfclf()Clears the active figure.
InterpreterHost
02

Reading availability

  • Interpreter means the built-in is dispatched by sun run.
  • LLVM means the audited native backend lowers the documented form.
  • Host means the operation requires host I/O, timing, filesystem, or figure support.
03

Numeric compatibility boundaries

  • accumarray currently performs dense sum aggregation for one- or two-column subscript matrices; function handles, explicit sizes, fill values, sparse output, and higher dimensions are not implemented.
  • acos, acosd, acosh, acoth, acsc, and acscd return complex values for scalar inputs outside their real domains.
  • acsch is real for nonzero real inputs, reaches signed infinity at zero, and accepts complex scalars.
  • all reduces all elements to one boolean because Sun does not yet have logical matrices or dimension-based logical reductions.
  • allbetween currently supports the closed three-argument form with real scalar bounds; interval-type and table options are not implemented.
  • Matrices currently store real f64 elements, so an element whose result would be complex is represented as NaN instead.
Source note

The function count is derived from the catalog. New runtime dispatch entries must be reflected here.