This manual contains information on Mathomatic equations.
Mathomatic is an interpreter that can:
Mathomatic is written in Microsoft C. The C source code is highly portable. It was developed on an MS-DOS system. Development started in the year 1986 on a Compaq Deskpro 286, greatly improved on an Acer 386, and it continues to be developed on a Pentium 133mhz running DOS.
If you wish to contact the author of Mathomatic, send mail to:
George Gesslein II 118 Sharpsteen Road Locke, New York 13092 USA
A math coprocessor will make Mathomatic run faster, but is not required. The Mathomatic Graph program requires an EGA or VGA color display.
The Mathomatic program is named either "am" or "ac". "ac" defaults to ANSI color mode, while "am" does not. ANSI color mode can be toggled by the "-c" option. ANSI color mode outputs ANSI escape sequences to make each level of parentheses a different color, to improve readability.
HTML color mode is enabled by the "-h" option. This makes Mathomatic output suitable for inclusion in a web page.
After any options, file names may be specified on the command line that will be read in with the "read" command.
Mathomatic equations are entered into equation spaces. The number of available equation spaces is displayed every time Mathomatic starts up. If you have enough RAM, there will be at least 5 equation spaces available, otherwise Mathomatic will complain and you will have less than 5 equation spaces. Currently, 20 is the maximum number of equation spaces possible in any version of Mathomatic.
The Mathomatic prompt contains the number of the current equation space (origin 1).
To enter an equation into the first available equation space, simply type the equation at the prompt. Equations consist of a Left Hand Side (LHS) and a Right Hand Side (RHS). The equation sides are separated by one, and only one, equals sign (=). An equation side consists of one or more variables or constants separated by operators. Parentheses may be used to override operator precedence.
An example of a valid equation follows:
c^2 = (a^2) + (b^2)
Constants are decimal, IEEE double precision (14 digit) floating point numbers. They may be entered in normal or scientific notation. They are displayed in normal or scientific notation, whichever is shortest.
Examples of equivalent constants in normal and scientific notation follow:
Normal Notation | Scientific Notation -------------------+--------------------------------- 10 | 1E1 (1.0 times 101) .1 | 1E-1 (1.0 times 10-1) 6000000000 | 6E9 (6.0 times 109)
Mathomatic results are almost always accurate to 14 digits. It is possible to get a result that is accurate to less digits, due to floating point inexactness, but you would have to really try.
Variables consist of a letter of the alphabet, possibly followed by a subscript from 0 to 62, possibly followed by up to 7 primes ('). Two letter variables are now supported. To input a two letter variable, separate the two letters with an underscore (_).
The following variables are predefined:
e# - The universal constant e. p# or pi - The universal constant pi. i# - square root of -1. sign, sign1, sign2, sign3, ... - may be +1 or -1.
By default, uppercase letters in variables are automatically converted to lowercase, so (A1'') is the same variable as (a1'').
To automatically enter a unique (sign) variable, precede any expression with "+/-".
Operators have precedence decreasing as indicated:
- negate ! factorial ^ power * multiply / divide + add - subtract = equate
Operators in the same precedence level are evaluated left to right.
The negate operator "-" may precede an expression, variable, or constant. The negate operator has the highest precedence of all operators.
Standard absolute value notation is allowed. "|x|" is converted to "(x^2)^.5".
The following example shows why operator precedence is important. Given the equation:
a = 64/-2^4 + 6*(3+1)
Mathomatic will first parenthesize the highest precedence operator (power) and then the lower precedence operators (times and divide). Addition and subtraction are the lowest precedence, so no need to parenthesize them. The result will be:
a = (64/(-2^4)) + (6*(3+1))
Mathomatic will evaluate this by combining constants from left to right on the same level of parentheses, deepest level first. So the calculations are performed in the following order:
a = (64/16) + (6*4) Combine deepest level parentheses first. a = 4 + 24 Divided 64 by 16 and then multiplied 6 by 4. a = 28 Added 24 to 4.
If the calculations were performed in a different order, the result would be different.
Mathomatic can perform complex number addition, subtraction, multiplication, and division. It can also do roots and powers of complex numbers. Complex numbers are in the form:
a + b*i#
where "a" is the "real part" and "b" is the "imaginary part". "a" and "b" may be constants, variables, or expressions. "i#" represents the square root of -1.
An example of complex number division follows:
1-> a=b/c #1: a = b/c 1-> calculate Enter b: 1+2*i# Enter c: 3+4*i# a = 0.44+(0.08*i#) 1->
Mathomatic has about 30 different commands that may be typed at its prompt. Please consult the Mathomatic Command Reference, for detailed information on commands. It is available in the file "am.htm". It can be viewed with a web browser or an HTML file viewing/printing program.
Copyright © 2000 George Gesslein II