How to use
- Type a calculation such as (12.5 + 7.5) * 3 or tap the keys. A grey answer appears under the line while the sum is complete.
- Press Enter or the = key to make it final. It goes into the history, and Ans stands for the last answer so you can carry on, for example Ans * 2.
- For sin, cos and tan choose Degrees or Radians first. In degrees, sin(30) is 0.5; in radians, sin(pi / 2) is 1.
- Tap a line in the history to bring that calculation back, and Copy result to put the last answer on the clipboard.
Examples
(12.5 + 7.5) * 3
→ 60Brackets first, then the multiplication.
0.1 + 0.2
→ 0.3Many calculators show 0.30000000000000004. This one rounds to 12 significant digits.
sin(30) in degrees
→ 0.5sin(180) gives exactly 0, not 1.2e-16.
5! and 2^10 and sqrt(144)
→ 120, 1024 and 12x! is the factorial, ^ is the power and sqrt is the square root.
How it works
The calculation is read and worked out by math.js (Apache-2.0), an open-source maths library, in a trimmed build that holds only the functions of a pocket calculator. Its commands for defining functions, importing code and doing symbolic work are not included, so a line can only do arithmetic. The keys of the pad type symbols such as × and √ that are changed into what the parser reads before it is worked out.
In degree mode the sin, cos and tan functions turn the number into radians first, and asin, acos and atan turn the answer back into degrees. A tiny leftover such as 6e-17 for sin(180) is set to zero. The result is shown to 12 significant digits, as a whole number when it is one, and as an exponent for very large or very small values.
The order of operations, the angle modes, the percent key and the error cases are covered by tests, and the keys and the history are checked in a real browser.
Sources
Frequently asked questions
- In what order does it work things out?
- Brackets first, then functions and factorials, then powers, then multiplication and division, then addition and subtraction. Powers go from the right, so 2^3^2 is 2^(3^2) = 512. A minus before a number is applied after the power: -3^2 is -9.
- Why is 0.1 + 0.2 shown as 0.3 here?
- Computers store decimals in binary, where 0.1 and 0.2 cannot be written exactly, so the sum is 0.30000000000000004 underneath. The answer is shown to 12 significant digits, which hides that last wobble. Results with more than 12 meaningful digits are not shown in full.
- What does the % key do?
- A number followed by % is that number divided by 100, so 50% is 0.5 and 200 * 15% is 30. For other percentage questions, such as the percentage change between two numbers, use the percentage calculator.
- Which functions can I use?
- sin, cos, tan and their inverses asin, acos, atan; log (natural logarithm), log10, log2; sqrt, cbrt, abs, exp; floor, ceil, round; mod(a, b); the factorial x!; combinations(n, k) and permutations(n, k); and the constants pi and e. Names can be typed in the line.
- What do the error messages mean?
- The calculator says so rather than guess. A bracket or an operator may be missing, a name may be unknown, tan(90) in degrees has no value, and a result that is too large or divides by zero is not a number.
- Is my calculation sent anywhere?
- No. It is worked out in your browser, and the history is cleared when you leave the page.
Related tools
Version history
- 1.0.0 — First release.