number
A numeric value. Arithmetic stays exact where possible, including integers, fractions, radicals, and bignums; operations that inherently use numerical approximation can return an approximate number.
A numeric value. Arithmetic stays exact where possible, including integers, fractions, radicals, and bignums; operations that inherently use numerical approximation can return an approximate number.
A true/false result -- from a comparison (==, !=, <, <=, >, >=, chains like 0 < x <= 1, and/or/not), or a yes/no function like isPrime() or divides(). Comparisons are exact: sqrt(2) < 1.4143 is decided without rounding. Inside arithmetic a truth value counts as 1 or 0, so sum(xs > 2) counts the elements above 2.
Text: "hello", joined with + ("n = " + 3/4 is "n = 3/4", exact), compared with == and <, indexed s[0] and sliced s[1:3] by character. "x = {x}" puts values into text; str/num convert, and split/join/upper/replace work on it (see Strings).
An ordered list of numbers -- from a [..] literal, or an array-producing function like divisors()/range()/cumsum().
A mutable display table. Create it with table(column...) and append scalar, vector, or matrix cells with addRow(table, value...). Tables render as structured tables in the terminal, browser, and TeX/PDF output.
A 2D vector, created by vec(x, y). Displayed in physics unit-vector notation ("3i + 4j"), not tuple form.
A 3D vector, created by vec(x, y, z).
A single complex number a + bi.
Several complex numbers together -- the roots solve gives when asked for "complex" ones.
A fixed 2x2 matrix, created by mat(...) with two row arrays.
A fixed 3x3 matrix, created by mat(...) with three row arrays.
A general dynamically sized matrix, including rectangular matrices and square matrices other than 2x2 or 3x3.
An unevaluated algebraic expression tree -- what diff()/expand()/factor()/collect() work with and return. A formula: step in .gdsl stays symbolic the same way.
A prime factorization, shown as an actual product (28 -> 2^2 * 7), not a flat list.
A 2D coordinate-geometry point, created by point(x, y) or returned by point-producing functions like midpoint()/intersect().
A 2D line in general form ax + by + c = 0, created by line(...)/lineFromPoints()/etc.
A circle in centre-radius form, created by circle(centre, r).
An axis-aligned ellipse (centre, semi-axes rx/ry), created by ellipse(centre, rx, ry).
3D direction ratios (a, b, c), created by ratios(a, b, c).
A user-defined function value (a closure) -- a bare reference to an fn you defined, not a call to it.
A structured result from a gtmath function: named fields, e.g. a root's x, residual and status, read with dot syntax (r.x), or an unnamed list of items read by index (g[0]).
Keys to values: {"Na": 23, "Cl": 35.5}. Read m["Na"] or m.Na, set m["K"] = 39, loop for (k in m); keys/values/has/delete/len. A bare name as a key is that name as text ({mean: 3}); keys may also be numbers.
A plotted function/data graph, created by graph() and built up with plot()/scatter()/bar()/title()/etc.
A drawn geometric-shape diagram (points/vectors/circles/lines), created by draw()/diagram().
A graph-theory network (nodes and edges), created by net(n) and built up with edge()/node() -- distinct from the plotting 'graph' type above.
A step-by-step recorded run of a graph algorithm, produced by dijkstra() for playback as an animation.
A step-by-step recorded run of a user-written array algorithm (comparisons/writes), produced by trace(arr, fn) for playback as a sort/array visualizer.
A recorded flowchart run of a user-defined function's control flow, produced by trace(fn, args...) for playback as a flowchart animation.
A data structure -- linked list, stack, circular queue, hash table (chaining or linear probing), BST/AVL tree, or min/max heap -- built by linkedList()/stack()/queue()/hashTable()/bst()/avl()/minHeap()/maxHeap(). Displays as a picture; operations such as insert()/remove()/search()/push()/pop()/traverse() mutate it in place and return a step-by-step animation.
A sequence of diagram frames, one per sampled t, produced by animate(tmin, tmax, n, fn) for playback as a continuous animation.
A turtle-graphics cursor (position, heading, pen state), created by turtle() and moved with forward()/left()/right()/etc.
A 3D surface-plot shader scene, produced by surface3d()/surfaceParametric()/curve3d() for rendering in the browser via WebGPU.
A CPU-sampled, colormap-colored 3D surface (MATLAB-style), produced by surf()/mesh()/surfc()/contour3() for rendering in the browser via WebGL2. Works in any WebGL2-capable browser, unlike webgpu3d.
An author-supplied external image reference, created by image("path.png"[, "caption"[, width]]), for embedding a figure in --tex output.
A picture coloured pixel by pixel, made by canvas(w, h, f). Shows as an image (with a PNG download) and goes into a PDF as a figure.