Operations

Every operation MathZetta reads, with editable examples in every output format.

Universal Operations

These operations are written in every output: JavaScript, Python, SQL, a spreadsheet formula, GLSL, LaTeX, MathML (drawn under each example), text and speech. Each example can be edited. Where a format can't write something (a spreadsheet has no integral) or there is no value yet (a variable without a number), that line says so.

Arithmetic Operations

+ Addition
Adds two or more numbers together.
Examples (editable):
- Subtraction
Subtracts one number from another. Can also be used as unary negation.
Examples (editable):
* × · Multiplication
Multiplies two numbers. Implicit multiplication (like 2x) is also supported.
Examples (editable):
/ ÷ Division
Divides one number by another. Can render as fraction in LaTeX.
Examples (editable):
^ Exponentiation
Raises a number to a power.
Examples (editable):
mod Modulo
Returns the remainder after division.
Examples (editable):
Note:
Automatically adds parentheses when needed based on operator precedence.
! Factorial
Calculates the factorial of a number.
Examples (editable):
Note:
For integers less than 13, outputs the multiplication expression. For larger values, calls factorial() function.

Mathematical Functions

sqrt Square Root
Calculates the square root of a number.
Examples (editable):
abs Absolute Value
Returns the absolute value of a number.
Examples (editable):
floor ceil Floor and Ceiling
Rounds down (floor) or up (ceil) to the nearest integer.
Examples (editable):
round Round
Rounds to the nearest integer or specified number of decimal places.
Examples (editable):
Note:
When decimals = 0, outputs simple Math.round(x). Otherwise uses power-of-10 technique.
fixed Fixed decimals
Like round, but always written with exactly that many decimals: fixed(2.5, 3) is 2.500. The answer is text — JavaScript's toFixed, Python's format, SQL's NUMERIC / printf, Excel's FIXED; GLSL has no text, so it rounds.
Examples (editable):
log ln Logarithms
Logarithm with specified base, or natural logarithm.
Examples (editable):
max min Maximum and Minimum
Returns the largest or smallest value from a list.
Examples (editable):

Trigonometric Functions

sin cos tan Basic Trigonometric
Standard trigonometric functions (sine, cosine, tangent).
Examples (editable):
arcsin arccos arctan Inverse Trigonometric
Inverse trigonometric functions.
Examples (editable):

Combinatorics

perm Permutations
Number of ways to arrange k items from n items.
Examples (editable):
Note:
For small integers (n < 21), outputs optimized multiplication expression.
comb choose Combinations
Number of ways to choose k items from n items.
Examples (editable):

Comparison and Logical Operations

= ≠ < > Comparison
Compare two values.
Examples (editable):
& | Logical AND/OR
Logical operations.
Examples (editable):

Set and Interval Operations

∈ Set Membership
Check if element is in a set.
Examples (editable):
∈[] ∈() Intervals
Check if value is in an interval.
Examples (editable):
{} [] () Brackets
Create sets, arrays, or tuples.
Examples (editable):

Mathematical Constants

π pi e Constants
Mathematical constants pi and e.
Examples (editable):

Variadic Operations

sum prod mean Aggregate Functions
Sum, product, and mean of multiple values.
Examples (editable):
\prod_ \sum_ Indexed Product/Sum
Product or sum over an index range. Uses LaTeX notation with subscripts and superscripts.
Examples (editable):

LaTeX and MathML Only Operations

These operations are primarily for rendering mathematical notation.

Advanced Mathematical Notation

Note:
These operations render complex mathematical notation in LaTeX and MathML format.
\int ∫ Integration
Integral notation with bounds. The indexed version uses subscript/superscript for limits.
Examples (editable):
\lim Limit
Limit notation approaching a value.
Examples (editable):