High Precision Complex Calculator Help

This program does real or complex number calculations with 100-significant-figure precision. Many standard functions are included. DO loops are supported. Both expressions and results can be saved to a file. A set of expressions to be evaluated is entered in FORTRAN syntax, in much the same way as writing a program.

Expression Entry
Enter the expression(s), one per line, using FORTRAN syntax then click the "Calculate" button to see the answer. The answer given is always for the last expression in the list. Press the Enter key to separate lines in the input field.

PI and E are predefined variables.

All numbers are interpreted as 100-significant-figure complex numbers regardless of the form of entry. Example: The program makes no distinction between 3 , 3., 3.E0, 3.D0 and (3,0).

All variables (except DO variables, see below) are interpreted as 100-significant-figure complex. Example: The program makes no distinction between variables beginning with letters I, X or Z.

A complex number, a + bi, where a and b are real constants or expressions, can be coded as (a,b). i is coded as (0,1). Examples: 2 + 3i can be coded as (2,3); cos(pi/6) + i sin(pi/6) can be coded as (cos(pi/6), sin(pi/6)) or as cos(pi/6) + (0,1)*sin(pi/6). Note that (x,y) is not a valid complex number unless x and y both evaluate to real numbers.   

The exponentiation operator is **. A**B is equivalent to A^B in BASIC or pow(A,B) in C.

Case is ignored for variable and function names. Example: QA, qA , Qa and qa are all the same variable.

One or more variables may be predefined then used in the final calculation.

Comments are delimited with an exclamation point (!). Everything after ! is ignored by the interpreter.

Buttons:
Open:
Open a file containing a set of expressions
Save As: Save the expressions on the screen to a file
Save: Save the expressions on the screen to last used file
Calculate: Calculate results for the current set of expressions
Help: Show this help file
Exit: Quit the program

Results Window
When the Calculate button is clicked, the results are shown in both exponential and fractional form. The exponential form is always displayed as a decimal (base 10) number. The fractional form can be displayed in any base from 2 to 36. A slider is provided to set the base. In base > 10, the letters A to Z are used to represent the digits 10 to 35.

Once the expression(s) have been calculated, they can be edited to yield a new result. Use ctrl+c to copy selected text and ctrl+v to paste.

Example 1. Real calculation
X = 2*SIN(PI/4)

1 + X**2 + X**4
! Correct answer is 7

Example 2. Complex calculation
z1 = (2, log10(1E3)) ! log10(1E3) = 3

z2 = (3,-2)
z3 = 2
(z1*z2)/z3
! Correct answer is 6 + 2.5i

DO Loops
One or more DO loops can be used in a set of expressions, but the DO loops cannot be nested. The DO variable is always a 100-significant-figure real. The DO loop must be terminated with an END DO statement.

WRITE Statement
The WRITE 'filename' statement can be used anywhere in a set of expressions to append the results of the previous line to the file named by 'filename'. The expression on the previous line plus the real and imaginary parts of the result are appended to the file.

Example 3. DO loop and WRITE statement
p = 3

DO X = 3, 7, 2
X
   WRITE 'testcal.dat' ! Writes value of X
   p = p + X
   WRITE 'testcal.dat' ! Writes value of p
end do
! Correct answer is 18

Functions and Operators
These standard FORTRAN functions and operators are supported for real and complex arguments:
ABS,  ACOS,  ASIN,  ATAN,  CONJG,  COS,  COSH,  EXP,  IMAG,  INT,  LOG,  LOG10,  NINT,  REAL,  SIN,  SINH,  SQRT,  TAN,  TANH,  =,  +,  -,  *,  /,  **

These functions use the real and imaginary parts of the argument as the two arguments of the standard FORTRAN function, as shown below, and return a real value:
ATAN2(x) = ATAN2(imag(x),real(x))
MOD(x) = MOD(real(x),imag(x)) 
MODULO(x) = MODULO(real(x),imag(x))
SIGN(x) = SIGN(real(x),imag(x))

License
High Precision Complex Calculator copyright © 2000 by Cliff Leitch. Multiple Precision Computation module used by permission of Dr. David M. Smith, Mathematics Department, Loyola Marymount University. This software may be freely copied, distributed, and used for personal or business uses, as long as it is not modified in any way.  However, it may not be offered for sale nor incorporated into another program. Any redistribution must include this help file and the 'readme.txt' file.

If you find this program to be of value, please consider contributing what you would have paid for it to your favorite charity!

Warranty
This software is offered "as is" without warranty of any kind. In no event shall the authors be liable for incidental or consequential damages, including but not limited to loss of use, loss of revenue or profit, loss of data or data being rendered inaccurate, or losses sustained by third parties even if the authors have been advised of the possibilities of such damages.

Return to Home Page