calculator

A plain four-function calculator: ten digits, a decimal point, add, subtract, multiply, divide, percent, sign flip and clear. It chains left to right the way a pocket calculator does, so 2 + 3 x 4 comes out as 20, not 14. Arithmetic is exact decimal to twelve places - 0.1 + 0.2 is 0.3, not 0.30000000000000004 - and dividing by zero shows Error instead of pretending.

Using