How to use the keypad

One keypad covers arithmetic, trigonometry, logarithms and factorials, plus four number bases and the bitwise operators that usually live in a separate programmer's calculator.

The arithmetic runs in the page itself, so the numbers you enter are not sent anywhere.

  1. Choose the number base in the first row, then the angle unit — Degrees or Radians — that the trigonometric keys should assume.
  2. Enter the expression on the keypad. The bracket field above the keys counts the parentheses that are still open.
  3. Press = to evaluate. An operation with no answer raises an alert and leaves the display as it was.
  4. Turn on Inverse functions or Hyperbolic functions before pressing sin, cos or tan to reach the keys behind them.

What each part of the keypad does

Number bases

Switching base converts the value on the display rather than relabelling it. Enter 255 with Hexadecimal selected, switch to Decimal, and the display reads 597; enter 255 in Decimal, switch to Hexadecimal, and it reads ff. Fractions survive the round trip too: 2.5 in decimal is 2.8 in hexadecimal and comes back as 2.5.

Scientific keys need decimals, so π, e, d.ms, sin, cos, tan and the decimal point work only while Decimal is selected. Binary leaves 0, 1 and the operators; Octal also keeps the digits 0 to 7; Hexadecimal adds A to F. Nothing on screen marks which base you are in, so the checked radio button is the only thing telling you how to read the number.

Angle unit and the two function layers

The Degrees and Radians buttons decide how sin, cos and tan read the display, and how asin, acos and atan write their answer back. In Degrees, sin 90 is 1 and asin 1 is 90; in Radians the same two keys give 0.8939966636005579 and 1.5707963267948966.

Inverse functions and Hyperbolic functions stack, and each one relabels the keys it changes: sin becomes asin, then hsin, then asinh (shown as ahs) with both switched on. The same switch turns the cube key into x^(1/3), ln into exp and log into expd. The hyperbolic keys ignore the angle unit — sinh 1 is 1.1752011936438014 in both modes — and acosh answers only from 1 upwards while atanh needs a value below 1 in magnitude.

Degrees-minutes-seconds, memory and clearing

d.ms rewrites the display as a packed decimal number: 45.5 becomes 45.3, meaning 45° 30′. Switching on Inverse functions relabels that key deg, and 45.3 converts back to 45.5. The converted value is an ordinary number in the display, not a formatted string.

MS stores the displayed value, MR recalls it, M+ and M× fold the display into it and MC empties it; the M field above the keypad marks a stored value. CE clears the current entry but keeps the pending operation — 5 + 3, CE, 2 = gives 7 — while AC clears the expression, the pending operator and the open brackets but leaves the memory alone.

Precision, limits and refusals

The engine is JavaScript's double-precision arithmetic and it shows: 0.1 + 0.2 is 0.30000000000000004 and cos 90° is 6.123233995736766e-17 rather than 0. Factorials overflow at 171 — 170! is 7.257415615308004e+306 and 171! is Infinity. NOT, AND, OR, XOR and LSH work on 32-bit signed integers, so NOT 0 is -1 and 1 LSH 31 comes back negative. FLOOR rounds toward negative infinity, not toward zero: FLOOR -7.9 is -8 while FLOOR 7.9 is 7, and the shifted key FRAC returns the part below the decimal point.

When an operation has no answer the page raises an alert and leaves the display untouched instead of writing NaN — division by zero, modulo by zero, 1/x of 0, the square root of a negative number and the factorial of a negative or fractional number all behave that way. The display is output only: every number has to come from the keypad, and nothing you press is uploaded.

Recent tools: