Calculator FX 570


The RISC OS Applications Suite comes complete with a simple calculator program, which is very useful since you can use it along side another program. Its usefulness is seriously impaired, though, because it is only a simple four-function calculator. That's where Calc_570 comes in - it is a complete scientific calculator for the desktop, with about 30 functions.

The calculator is loaded by double-clicking on its icon in the Filer window. The icon then sits quietly on the icon bar until you want to work something out. When you do, clicking with SELECT or ADJUST pops up the calculator window. Clicking with MENU calls up a simple menu, with just the normal Info and Quit options.

The calculator does not use the computer's keyboard: instead you press the 'buttons' on its keypad by clicking on them with the mouse (any mouse button will do). Therefore, 'button' or 'key' refer to the icons on the calculator's keypad.

At the top of the calculator there is a display area, called the LCD. This has four displays in it. The main display holds the mantissa (that's the basic number; initially it is 0). An exponent (power of 10 to which the mantissa is raised) is shown superscript to the right, as on most calculators. To the left of the mantissa there are two flags, one for the Memory and one for the Mode (see below).

Using the calculator is in the main just like using an ordinary one. To enter a number, click on the appropriate keys in the keypad. For example:

-3.456 is rendered by [3] [.] [4] [5] [6] [+/-]

3*10-8 is rendered by [3] [EXP] [8] [+/-] (and notice that the 
power of ten, the figure 8, is shown superscript!).

The following keys have the highest operator precedence, that is they act immediately on the number displayed in the LCD (the 'X register' as it is called) and put the result straight there. They do not affect the 'running total' or 'Accumulator'.

[SQR] - square root of number
[log] - logarithm to base 10
[ln]  - natural logarithm (base e)
[PI]  - returns the number 3.14159265 (pi!)
[x!]  - factorial (the product of all the integers between 1 & x)
[ilg] - inverse log to base 10
[e^x] - inverse natural logarithm
[1/x] - reciprocal
[+/-] - change sign of number
[SIN] [COS] [TAN] - sine, cosine and tangent respectively
[ASN] [ACS] [ATN] - inverse trig. functions
[SNH] [CSH] [TNH] - hyperbolic sine, cosine and tangent
[ASH] [ACH] [ATH] - inverse hyperbolic functions


The next set of operators have second highest priority. They take two operands, one before the operator key, one after it, for example [3] [x^y] [2] means 32.The first operand is called 'x' and the second 'y' (or the 'Y register').

[x^y] - work out x raised to the power y
[nPr] - no. of permutations of y objects from x
[nCr] - no. of combinations of y onjects from x

The [x] (multiply) and [/] (divide) keys have the next lowest priority, and the [+] and [-] keys the lowest.

The [RND] key generates a random number between 0 and 1.

The memory is controlled as follows: 

[Min] pushes the X register into the memory
[MR]  returns the memory into the X register
[M+]  adds the X register to the memory
[M-]  subtracts the X register from the memory.

[X>M] swaps over the X register and the memory.

[X>Y] is more complicated - it swaps over the operands of a binary operator. For example, [3] [-] [2] [X>Y] [=] works out 2-3 instead of 3-2.

The calculator works in degrees (DEG) or radians (RAD). To select one or the other, press the button on the calculator, and it becomes inverted.

The [C] key is Clear - it sets the displayed number to 0. For example, [3] + [2] [C] [3] [=] evaluates 3+3 : the 2 was wiped out by the [C] key. The [AC] key is All Clear - it resets the calculator and forgets any calculation you are doing. It is also used to clear errors. (If an error occurs, such as division by zero, the LCD shows "Err" and an error number, which gives the error code, as in the BBC Basic Guide, and the line number where the error happened. That way you can correct any mistakes in typing in the program).

The calculator can work to either a fixed number of significant figures (sig. fig) or decimal places (dp). To display to a fixed number of dps, press [FIX] followed by a number. Eg. [FIX] [3] sets 3 dps, and a 'F' appears in the LCD.

To select a fixed number of sig. fig., press [SCI] and a number. Eg. [SCI] [3] sets 3 sig. fig., and a 'S' appears in the LCD. To turn off either FIX or SCI notation, press [FIX] or [SCI] and then [.].

The program knows the value of nine physical constants, which are accessed via the [CST] key. The following values are available.

[CST] [1] Speed of light in vacuo (c=299792458 ms-1)
[CST] [2] Planck's Constant (h=626176 E34 Js)
[CST] [3] Universal Gravitational Constant (G=6.672 E-11 Nm2kg-2)
[CST] [4] Electronic Charge (e=1.6021892 E-19 Coulombs)
[CST] [5] Electronic Mass (m=9.109534 E-31 kg)
[CST] [6] Atomic Mass Unit (U=1.6605655 E-27 kg)
[CST] [7] Avogadro's Number (A=6.022045 E23 per mole)
[CST] [8] Boltzmann's Constant (k=1.380662 E-23 JK-1)
[CST] [9] Molar Volume of ideal gas at stp (V=0.02241383 m3mol-1)

Simple help messages are available through !Help. The function of any button under the pointer is given, and simple instructions for its use. Also, if you have pressed [CST], the nine constants are given. Any error message is displayed in full.

Note: BASIC's rather poor accuracy poses some problems. In particular, the largest number available is about 1038. Also, using a FIX to many dps can cause serious accuracy errors in some cases, such as SQR 144 giving 11.99999999. Problems only arise if the mantissa is over nine digits long.
