Variables and custom functions

Angle mode
?

DEG uses degrees: sin(30) = 0.5. RAD uses radians: sin(pi/6) ≈ 0.5. Explicit angle units override this choice.

M = 0

Use a decimal point and * for multiplication.

Uses Calculator arithmetic, angle and word settings. Definitions stay in this page unless needed by saved history.

No definitions yet. Define rate = 0.21, then total(netAmount) = netAmount*(1+rate).

Names, dependencies & examples

Names are case-sensitive ASCII letters, then letters, digits or underscores; up to 32 characters. Built-in functions, units, constants, Ans and M are reserved. Define a name before referring to it. Cycles and recursion are refused; a rejected edit keeps the previous definition.

Variables: rate = .21. Functions: name total, parameter netAmount, formula netAmount*(1+rate). Calculate total(100) for 121. Functions have 1–8 unique parameters. Ans/M are not allowed in definition formulas: save an explicit named value instead.

Define a name, then evaluate an expression

Save a variable with a value or formula, or save a function with 1–8 named parameters. The expression field above evaluates in that same local definition context. A definition must exist before another formula refers to it.

Names are case-sensitive letters followed by letters, digits or underscores, up to 32 characters. Built-in names, units, constants, Ans and M are reserved. Cycles and recursion are refused. Definitions stay in this page unless a needed frozen snapshot is included in optional history; restoring history does not replace the current library or memory.

Worked example: rate = 0.21

Save a variable named rate with value 0.21. Evaluate 100*(1+rate) to obtain 121. Load example fills those fields; first save the definition and then Calculate.

To use a function, save total with parameter netAmount and formula netAmount*(1+rate). Evaluating total(100) gives 121. Changing rate to 0.09 invalidates a dependent current answer; an old saved calculation retains its frozen definitions.

Load example fills the form without calculating. Choose its primary action to work it out.

Sources and related calculators

The method and worked example here are original. Sources describe the underlying mathematics or notation; calculation choices and limits are in the precision and syntax guide.