CalcAnyway · Usage guide · updated 2026-09-27

Formulas and functions — what a calc card can compute

This page covers writing formulas in a calc card and the symbols and functions they can use. For example, $870 shared by 24 people is $36.25 each. Rounded up to a whole dollar with ceilto(…, 0), the fee is $37.

Board 1

Open in CalcAnyway ↗

You can change the numbers here too, but changes made in this frame are not saved. To keep them, open it in CalcAnyway and edit there.

The two cards on the left are input cards holding the total cost and the number of people. The three on the right are calc cards. The upper line of a card is its formula; below the dotted line is the result. Per person is Total cost ÷ People: 870 ÷ 24 is $36.25. Fee rounds that up to a whole dollar with ceilto, giving $37. Collected is Fee × People, $888, which is $18 more than the total cost.

With People at 25, Per person becomes $34.8, Fee $35 and Collected $875. That is $5 more than the total cost. The blue labels in a formula, such as Total cost and People, are the parts that use other cards' values.

Typing a formula

Pressing the upper line of a calc card (above the dotted line) opens its formula for editing. On a computer you can type the formula with the keyboard; Enter confirms it and the result is recalculated.

The calculator at the bottom of the screen can also type into it. On a phone, tapping the formula opens the calculator. "Done" on the calculator keeps the formula, and "Discard" returns it to how it was before editing. The ︿ (Expand keyboard) at the top of the calculator adds the keys for brackets, powers and functions.

Multiplication and division can be typed as * and / or as × and ÷; the card shows × and ÷ either way. The decimal point is ".". Outside a function, a thousands comma is fine: 1,000+1 gives 1,001.

Using values from other cards (references)

A formula can use the value of another card; this is a reference. A reference appears in the formula as a label with the card's name. A card without a name appears by its number, such as "#1". Renaming a card in its name field changes the label in every formula that uses it. When a referenced value changes, the formula is recalculated automatically.

Adding a reference by drawing a line

A selected card shows a ○ on its right edge. Dragging that ○ onto the card whose formula should use it opens "Choose an operator" with "Add (+)", "Subtract (−)", "Multiply (×)" and "Divide (÷)". The chosen operator and the reference are added to the end of the formula.

On a card with an empty formula, "Add (+)" leaves just the reference. "Multiply (×)" makes the formula start with an operator (× People), which cannot be calculated.

With the card selected, each line into it shows an operator in a circle and a red ×. Pressing the operator changes it in the formula, in the order × → ÷ → + → −. The circle on the first reference switches between + and −; − subtracts that value (− People …). The red × removes the line, and the reference and its operator disappear from the formula.

Inserting a reference while typing

While editing a formula, typing [ opens the "Ref" list of cards. Typing a card number after it narrows the list ([4 for card #4). Choosing a card puts its reference label at that position. The chain icon to the left of the formula on the calculator ("Insert a reference to another card") opens the same list.

A card that would create a loop is marked "(makes a loop)" in the list. In a loop, A's formula uses B and B's formula uses A, so no answer can be worked out.

Replacing a reference with another card

Pressing a label does not change what it refers to. To replace it, edit the formula and press Backspace (⌫ on the calculator) right after the label. The label is removed; typing [ in the same place and choosing another card puts the new reference there. Once the formula is confirmed, the line comes from the new card.

Operators and symbols

A formula is worked out in the usual order: multiplication and division come before addition and subtraction.

Operators and symbols in a formula
SymbolMeaningExample and result
+ −Add, subtract5−3 → 2
× (*)Multiply3×4 and 3*4 are the same: 12
÷ (/)Divide8÷2 → 4
^Power, worked out from the right2^10 → 1,024; 2^3^2 → 512
( )Brackets: worked out first(1+2)×3 → 9
%Percent (next section)10% → 0.1
,Separates the numbers given to a functionroundto(3456, 2)
!Factorial; whole numbers from 0 to 1705! → 120
°Degrees, even when the angle unit is RADsin(90°) → 1
e (after a number)Scientific notation: times a power of ten2e3 → 2,000

A few ways of writing change the result.

  • -2^2 is −4, because the power is worked out first. For the square of −2, (-2)^2 gives 4.
  • Brackets or π written right after a number multiply it: 2(3+4) is 14.
  • That group is worked out before a division: 6÷2π means 6÷(2π), 0.95493.

% is a share of the number before it

% goes after a number. What it does depends on the operator in front of it.

Board 2

Open in CalcAnyway ↗

You can change the numbers here too, but changes made in this frame are not saved. To keep them, open it in CalcAnyway and edit there.

The price on Board 2 is $80. Price + 10% adds 10% of the price, giving $88. Price - 20% takes 20% of the price away, giving $64. Price × 10% multiplies by 10% as 0.1, so the tax amount is $8.

  • 10% on its own is 0.1.
  • When an addition comes before it, as in 1200 + 50 + 10%, 10% of the running total (1,250) is added: 1,375.
  • 1200 + 10% + 10% adds 10% twice in a row, giving 1,452, not the 1,440 of adding 20% once.
  • A % can follow another card's value: with a Tax rate card at 10, Price + Tax rate% is 88 when the price is 80.

Some article boards write "÷ 100" instead of %. Either way can express the same calculation.

Functions

A function takes its numbers in brackets after its name. Two numbers are separated by ",". The brackets can hold references and whole formulas as well as numbers, for example ceilto(Total cost / People, 0). Names work in lower or upper case.

Functions (the keys appear when the calculator is expanded)
Written asCalculator keyMeaningExample and result
sin(angle)sinSinesin(30) → 0.5
cos(angle)cosCosinecos(60) → 0.5
tan(angle)tanTangenttan(45) → 1
asin(x)sin⁻¹Inverse of sin; the answer is an angleasin(0.5) → 30
acos(x)cos⁻¹Inverse of cosacos(0.5) → 60
atan(x)tan⁻¹Inverse of tanatan(1) → 45
log(x)logCommon logarithm (base 10)log(100) → 2; log(0.001) → −3
ln(x)lnNatural logarithm (base e)ln(E) → 1
exp(x)eⁿe to the power of xexp(1) → 2.718282
sqrt(x)√Square root; √9 also workssqrt(9) → 3
abs(x)absAbsolute value (the number without its sign)abs(−3) → 3
min(x, y, …)minThe smallest; takes two or moremin(3, 1, 2) → 1
max(x, y, …)maxThe largest; takes two or moremax(3, 1, 2) → 3
gcd(a, b)gcdGreatest common divisor of two whole numbersgcd(12, 18) → 6
lcm(a, b)lcmLeast common multiple of two whole numberslcm(4, 6) → 12
quot(a, b)quotWhole-number part of a ÷ bquot(17, 5) → 3
rem(a, b)remRemainder of a ÷ brem(17, 5) → 2
roundto(x, p)roundtoRound to the nearest, at a placeroundto(3456, 2) → 3,500
floorto(x, p)floortoRound down, at a placefloorto(3456, 2) → 3,400
ceilto(x, p)ceiltoRound up, at a placeceilto(3456, 2) → 3,500
PIπPiPI → 3.141593
EeEuler's number (the base of ln)E → 2.718282

Some calculator keys are not functions: they add symbols to the formula. They cannot be typed as names; square(3) shows "Can't calculate".

Keys that add symbols to the formula (they cannot be written as function names)
Calculator keyWhat it addsExample and result
x²^2 after the current number12 → 12^2 → 144
1/x^-1 after the current number4 → 4^-1 → 0.25
x!! after the current number5 → 5! → 120
10ˣ10^(10^(3) → 1,000
±Switches the sign of the last number100+50 → 100-50
DEG / RADSwitches the angle unit (see trigonometry below)—

floor (round down to a whole number), ceil (round up) and round (round to the nearest) are not on the calculator but can be typed. floor(-2.5) is −3, ceil(2.1) is 3 and round(2.5) is 3.

quot and rem with negative numbers

quot is the whole-number part of a division and rem is its remainder. Board 3 splits minutes into hours and minutes.

Board 3

Open in CalcAnyway ↗

You can change the numbers here too, but changes made in this frame are not saved. To keep them, open it in CalcAnyway and edit there.

135 minutes is quot(135, 60) = 2 hours and rem(135, 60) = 15 minutes. With Minutes at −135, Hours becomes −2 and Minutes left −15. quot cuts the quotient toward 0, and the remainder from rem takes the sign of the number being divided.

The same rule holds for a negative divisor: quot(17, -5) is −3 and rem(17, -5) is 2. Some definitions keep the remainder at 0 or above; rem does not.

The second number of roundto, floorto and ceilto

The second number names the place to keep, as a power of ten. 3 keeps the thousands (10³), 0 the ones, and −1 the first decimal place.

Board 4

Open in CalcAnyway ↗

You can change the numbers here too, but changes made in this frame are not saved. To keep them, open it in CalcAnyway and edit there.

The number on Board 4 is 1,234.567. With 3 as the second number it becomes 1,000; with 2, 1,200; with 0, 1,235. With −1 it is 1,234.6, and with −2, 1,234.57. The sign is the opposite of Excel's ROUND: ROUND(x, 2) keeps two decimal places, while roundto(x, 2) keeps the hundreds.

A number exactly halfway is rounded away from 0. With Number at 2.5, the result to the ones is 3. At −2.5 it is −3. floorto rounds toward the smaller number and ceilto toward the larger: floorto(-3456, 2) is −3,500 and ceilto(-3456, 2) is −3,400.

The second number is a whole number from −50 to 50; roundto(3456, 1.5) shows "Can't calculate".

Trigonometry and the angle unit

sin, cos and tan take their angle in degrees to begin with: sin(30) is 0.5. The DEG key on the calculator switches to RAD, and angles are then read as radians. The unit is kept with the board, so anyone it is shared with gets the same answers.

In degrees, sin(PI) is the sine of 3.14159… degrees: 0.054804, not 0. A formula written for radians needs RAD first. An angle with ° after it is read as degrees even in RAD. asin, acos and atan answer in the current unit (in degrees, atan(1) is 45).

log, ln and exp

log is the common logarithm, base 10: log(1000) is 3. ln is the natural logarithm, base e. exp(x) is e to the power of x, not the EXP (×10 to a power) key of a pocket calculator. A power of ten is written with the 10ˣ key, which adds 10^(, or in scientific notation such as 2e3.

When a result is an error

When a formula cannot be calculated, the card shows a short reason in place of the result. With People at 0 on Board 1, Per person becomes 870 ÷ 0 and shows "Cannot divide by 0". Fee and Collected, which come after it, show "Upstream error".

What a card shows when it cannot calculate
ShownHappens with
Cannot divide by 01÷0, quot(1, 0), rem(1, 0), 0^-1
log 0 is undefinedlog(0), ln(0)
No real-number answersqrt(-1), log(-1), asin(2), (-8)^(1/3)
tan undefined (odd multiple of 90°)tan(90)
Angle too largeAn angle of 10¹⁰ or more, such as sin(1e10)
x! needs a whole number ≥ 02.5!, (-1)!
Number out of range171!, exp(1000)
Unclosed parenthesis(1+2
Use "." for decimalsA comma used as the decimal point, as in 1.234,5
Can't calculatemin(5), gcd(1.5, 3), roundto(3456, 1.5), a formula ending in 12×
Upstream errorA referenced card shows one of the errors above
Circular referenceA refers to B and B refers to A
No value to referenceThe referenced card cannot be found

A formula that references a card in error shows the label as "? (Per person)". Fixing the first card lets the connected cards calculate again.

How many digits are shown

Results show up to six decimal places, rounded at the seventh, without trailing zeros. Thousands are separated with ",". Changing the digits shown does not change the value passed on to other cards.

Board 5

Open in CalcAnyway ↗

You can change the numbers here too, but changes made in this frame are not saved. To keep them, open it in CalcAnyway and edit there.

Per person on Board 5 is 100 ÷ 3, shown as $33.333333. 2 places shown is the same value with 2 decimal places: $33.33. Times 3 multiplies it by 3 and gives $100, because the value inside is still 33.333333….

To change the value itself, a function does it. Cut below a cent is floorto(Per person, -2), $33.33, and three times that is $99.99.

Decimal places can be set in three places.

  • One card — while editing the card's formula, "Result settings" to the left of the result on the calculator; under "Decimal places", Auto or 0–4.
  • The whole board — "Decimal places (this board)" in the ☰ menu. It starts at "Follow app default".
  • The whole app — "Default decimal places (app)" in the ☰ menu. It starts at Auto.

A card's own setting comes first, then the board's, then the app's. With 0–4, the result is shown with exactly that many places, padded with zeros (2 shows 10,000.00). In Auto, a number too small to show in six decimal places is shown as 0.000012345 or 1e-7. A number above 9,007,199,254,740,991 is shown in scientific notation, as with 170!: 7.257415615308e+306.

Articles that use this

When it does not work

  • max(1,000, 2) gives 2 — inside a function's brackets "," separates numbers, so this reads as three numbers: 1, 000 and 2. Numbers inside a function are written without thousands commas: max(1000, 2).
  • "Can't calculate" right after drawing a line — connecting to an empty formula with "Multiply (×)" or "Divide (÷)" makes the formula start with an operator. Pressing the operator on the line until it shows +, or deleting the operator at the start, fixes it.
  • sin(PI) is not 0 — the angle unit is still degrees (DEG). The DEG key switches it to RAD, and the result becomes a value very close to 0, such as −3.73566e-20.
  • square(3) or sign(-3) cannot be calculated — x², ±, 1/x, x! and 10ˣ are key names, not functions. They are written 3^2, 3^-1, 3! and 10^3.
  • A total does not match what the cards show — decimal places change only what is shown. floorto, roundto and ceilto round the value itself, as on Board 5.
  • "Upstream error" — the error is in a card this formula references, not in this formula. Following the labels shown as "?" leads to the card with the error.

Read next — Input types How the numbers a formula uses can be changed with a number field, ± buttons or a slider, and how range, step, units, decimal places and recording work.


Back to the usage guide →