Advanced
The power-user and programmer corner: prev, bitwise, number bases, factorial, scientific notation, percent change.
The everyday math lives in the earlier topics. This page gathers the sharper tools in one place, for power users and programmers.
prev and line references
prev is the result of the nearest value line above, so you can build a calculation step by step without naming each one. R2 points at a specific line (the number in the left gutter). Both carry units along. See Totals & references for the full rules.
Scientific notation
Show any result in scientific form with "in sci" (or "in scientific"). It uses the full-precision mantissa, so nothing is rounded away.
Percent change
Measure the change between two numbers with "percent change from A to B". A drop reads as a negative percent. See Percentages for the shorter "A to B is what %" form and the other percent questions.
Bitwise operators
Whole-number bitwise math: & (and), | (or), xor, and the shifts << and >> all work on integers.
Number bases
Write hex, binary or octal literals with 0x, 0b or 0o. They keep their base as you calculate, so a sum of hex stays hex. Turn any number into another base with "to hex", "to binary" or "to octal".
Factorial
factorial(n) or the shorthand n! multiplies every whole number down to 1.
CSS and typographic units
For front-end work, px, pt, pc, em and rem convert among themselves and to physical lengths. em and rem assume the usual 16px base, so 1.5 rem is 24px.