Working with variables

Variables let you reuse a value, parameterize a formula, and test the same calculation with different inputs.

In the quick calculator, Vars opens a drawer containing the ten variables x, y, z, a, b, c, d, r, h, and w. Press a variable button to insert its identifier into the formula.

variables drawer

You can edit a value directly in its field or press the shift key and then a variable button to store the current result. Shifted variable buttons display an arrow to indicate assignment.

variables shifted

This is useful for intermediate results. Calculate the first value, press the shift key, and store the result in a variable such as x. Insert x into the next formula when that value is needed.

Pressing = records the formula, result, and variable values in the print roll. The print roll is editable and can be saved to a file.

Variables in calculation sheets

Calculation sheets are not limited to the ten quick-calculator variables. Define a descriptive identifier with an assignment and use it on later lines:

distanceKm ⁣:travelled distancetimeHours ⁣:elapsed timedistanceKm=3.5timeHours=0.75speed=distanceKmtimeHours \begin{aligned} \mathrm{distanceKm} &\colon\quad \text{travelled distance} \\ \mathrm{timeHours} &\colon\quad \text{elapsed time} \\[0.6em] \mathrm{distanceKm} &= 3.5 \\ \mathrm{timeHours} &= 0.75 \\ \mathrm{speed} &= \frac{\mathrm{distanceKm}}{\mathrm{timeHours}} \end{aligned}

The sheet runs from top to bottom, so every identifier must be assigned before it is used. Use explicit multiplication, such as 2*distanceKm, to keep multi-character identifiers unambiguous.

When the quick calculator detects variables in a formula, a line below the formula lists the values used:

var example1

Memory

The quick calculator also has conventional calculator memory. You can store, add, subtract, recall, or clear its value. Memory is separate from variables.

memory display

You can cut & paste from this location as well.