| ||||||||||||||||||
Mathematical Expressions
UltimaCalc does not try to mimic a hand-held pocket calculator with loads of keys. Instead, it uses conventional mathematical notation entered as plain text. So you can read an expression, type it in directly as you read it, and get it evaluated by hitting the 'Enter' key. You can change the expression, and evaluate it again.
Simple arithmetic expressions are simple, being made up of just numbers and
operators: two plus three is 2+3 and five seventeens are 5*17 (you can add
spaces between the terms if you want to).
Twelve minus four is 12-4 and eight hundred divided by eighty-one is 800/81. (Try
this, with the precision set to Automatic, and notice what happens as you change the width of the window by
dragging one of the edges).
Now, plenty of calculators ignore the rules of arithmetic. These rules say that multiplication and division
are to be considered more important than addition and subtraction (they have higher precedence). Suppose you
try to evaluate 2+3*4. The rules say that you should first multiply 3*4 (which
gives 12) and then add the 2, giving a result of 14.
Be warned that loads of calculators think they know better. They work out 2+3 first, to
obtain 5 , and then multiply this by 4 to obtain 20.
If this was really what you wanted to calculate, the rules of precedence for arithmetic operators state
that you should write your calculation as (2+3)*4 in order to have the addition performed
before the multiplication.
Algebra
Algebra differs from arithmetic by using names to represent numbers. With UltimaCalc, you can define a name and give it a value by entering a name followed by an equals sign followed by the expression which UltimaCalc is to calculate to produce the value.
For example: a = 4 tells UltimaCalc that until further notice it is to replace all
occurrences of a with the value 4. UltimaCalc also allows you to place more than
one expression in a line, by separating them with commas or semicolons.
So you can enter a = 4, b = 5, a * b and UltimaCalc will return the value 20.
If you now delete this text and enter b/a, UltimaCalc will respond with 1.25 as
it has remembered the values of a and b. When you stop the program, UltimaCalc
will save this information in a file, and read it in the next time you run the program.
If there is a problem with an expression, UltimaCalc will inform you.
As for spaces, you can add spaces between numbers and operators, but don't insert a space inside a number
as the space will be treated as marking the end of the number. And don't put commas inside numbers, for
example to mark off thousands. UltimaCalc will consider that 1,000,005 is not one million and
five, but the three distinct numbers one, zero, and five, and it will only remember the last of these, namely five.
