Introduction
Welcome to JAVA-CALC. If you are familiar with any RPN calculator from HP or the programming language FORTH you probably do not need to read this manual at all. JAVA-CALC is written completely in Java-Script and best viewed with NETSCAPE 3.0 (if you do not have NETSCAPE, get version 3.0 now).
Why RPN?
Reverse Polish Notation is a highly extensible notation for calculating equations and whatsoever. The highly familiar INFIX notation used for many house-hold calculators has the operator between the operands. An example would be: 3*(7+8) The big disadvantage of this notation is that the first operand is not available by the user after the operator is given meaning that this notation is almost not user-extensible at all. RPN on the other hand is a POSTFIX notation with the operator after the operands. The example above in RPN would be: 3 7 8 + * The first thing noticable is that no brackets are required. Also, this notation is higly extensible since both operators are available for a user defined extension. Also, to distinguish between numbers entered by the user a ENTER key is required.
Requirements
Any browser incorporating Java-Script is usable. JAVA-CALC has been tested on the following platforms: - SUN IPX under SOLARIS 2.4 with NETSCAPE 2.0/3.0B4. - HP715/735 under HP-UX with NETSCAPE 2.0/3.0B4. - MAC PPC under SYSTEM 7.5.2 with 8MB and NETSCAPE 2.0/3.0B4. - PC (PENTIUM) under WINDOWS 95 with 32MB and NETSCAPE 2.0. JAVA-CALC does NOT run on the following platform(s): - PC under WINDOWS 3.11 with NETSCAPE 2.0
Data types
Currently JAVA-CALC has two data types: - REAL within a range of app. -1e308.. +1e308 and an accuracy of app. 15 digits. - COMPLEX within a range of -1e308-i1e308...+1e308+i1e308 and an accuracy of app. 15 digits for both parts.
The Input Stack
JAVA-CALC incorporates a stack with a depth of 4 with the X-Register being on top of the stack and the T-Register being on the bottom. It can be shown that any equation can be calculated with this stack. Any number entered by the user is pushed onto the stack while the stack itself is scrolled. To enter two numbers the ENTER key must be pushed inbetween. This is the only time when the ENTER key is required. Thus, calculating the following: 3*(7+8) the user must press the following keys: 3 ENTER 7 ENTER 8 + * Functions which require only one operand (like sin, cos etc.) do not require to press the ENTER key. Hence, calculating: sin(3*PI) the user must press the following keys: 3 PI * SIN
Keys of the Calculator
0...9 : the usual keys found on any calculator. . : distinguishs between integer part (IP) and floating part (FP). E : used to enter numbers to the power of 10 (e.g. 1.2e117). +/- : changes the sign of either the mantissa or the exponent. depending how far the user has input a number already.. <- : deletes either the last input of the user or the number in X. PI : puts PI (3.141592653589793...) onto the stack. + : X=Y+X - : X=Y-X x : X=Y*X / : X=Y/X SCROLL: scrolls the stack down, i.e., X=Y, Y=Z, Z=T. SWAP : swaps X and Y. NEXT : displays the next line in a menu. PREV : displays the previous line in a menu. F0..F5: function keys, depending on the menu. 1/X : X=1/X Y^X : X=Y^X X^0.5 : X=X^0.5 X^2 : X=X^2 LOG X : X=log(x), i.e., logarithm to the base of 10. 10^X : X=10^X LN X : X=ln(x), i.e., loagrithm to the base of e (2.718281...). e^X : X=e^X SIN X : X=sin(X) COS X : X=cos(X) TAN X : X=tan(X) ASIN X: X=asin(X) ACOS X: X=acos(X) ATAN X: X=atan(X) EXIT : exits any menu, currently displaying the RCL menu. STO : displays the STO menu to store variables. RCL : displays the RCL menu to recall previously stored variables. DISP : displays the DISP menu. MODES : displays the modes menu. COMPLX: displays the complex menu. PROB : displays the probability menu. CONST : displays the constants menu. CONVRT: displays the convert menu.
The Menu
- STO displays ST 0...ST 5 to store five user-defined variables. - RCL displays RCL 0...RCL 5 to recall fiver user-defined variables. - DISP menu for changing the way numbers are presented. - FIX fixed length representation with X digits. - SCI scientific representation with X digits. - ENG engineering representation with X digits, exponent is a multiple of 3. - ALL all digit representation. The current representation is displayed in the status-line. - MODES menu for changing the representation of angles. - DEG degree with 360 units. - RAD radiant. - GRAD degree with 400 units (new degree). The current setting is displayed in the status-line. - COMPLX menu for complex variables - Y,X->Y+iX converts two real numbers in X and Y into a complex number in X. - Y+iX->Y,X converts a complex number in X into two two real numbers in X and Y. - ABS absolute value of a real or complex number in X. - ARG argument of the complex number in X equals to ARCTAN (IM{X}/RE{X}). - CONJ conjugate complex of X equals to RE{X}-IM{X}. - PROB menu for calculating probabilities - COMB combinations of Y and X equals to Y!/(X!(Y-X)!). - PERM permutations of Y and X equals to Y!/(X-Y)!. - N! calculates X!. - GAMMA calculates gamm(X), equals to (X-1)!. - RANDOM recalls a random number (currently only working with UNIX-NETSCAPE). - CONST menu for displaying physical constants - E0 recalls the electric field constant. - mu0 recalls the magnetic field constant. - h recalls Plancks constant. - e recalls charge of an electron. - mp recalls mass of a proton. - me recalls mass of an electron. - c recalls speed of light. - Vair recalls speed of sound in air. - g recalls gravity constant of the earth. - CONVRT menu for converting values - ->DEG converts a radiant number in X into degree. - ->RAD converts a degree number in X into radiant. - ->HR converts a time in X in the form of HH.MMSS into a fraction numbered time. - ->HMS converts a fractioned numbered time in X into the form of HH.MMSS. e.g. 1.125hrs are converted to 1.0730, meaning 1hr 7min and 30sec. - IP integer part of X. - FP floating part of X. - ABS absolute value of X. - SIGN sign of X: -1 for X<0, 0 for X=0, and +1 for X>0. - MOD Y modulo X.
Known Bugs
- NETSCAPE 2.0 for WINDOWS 3.11 seems to have problems executing large Java-Script files, possibly due to poor memory management (what a surprise!). If so, get NETSCAPE 3.0. - Incorrect results like NaN or +Infinity can be scrolled by the stack. - NaN is displayed as: NaNeNaN. - The RANDOM function in the PROB menu works only with NETSCAPE 2.0 or higher for UNIX (due to a bug in NETSCAPE). - Fixed-Width fonts on buttons do not work properly with NETSCAPE 2.0 for WINDOWS 95, reendering the buttons not uniformly. - Different Operating Systems require different screen estates to display the calculator entirely. On a SUN IPX any screen larger than 800X600 pixels is big enough.
Updated: 06-21-1996
Please send comments and bug reports to: mossbruc@egr.msu.edu