Calculator

The calculator application can be used as a scientific calculator, but its primary purpose is to be linked into Combine. The A, B, and C keys on the calculator refer to the three databases in Combine, so Calculator can be used to produce expressions built out of them easily.

To use the calculator with Combine, link Calculator into Combine. Build an expression with the buttons on Calculator, then hit the Send button. Combine will display the combination image. If Combine has selected a function with its Function button, choose Calculator on that button, and Combine should display the calculator result.

Controls

Most of the controls on Calculator are buttons that are the same as are on a scientific calculator. To use it, enter the expression (in standard infix/postfix notation, not RPN) and hit the equals sign button (the one on the lower right). Calculator will attempt to simplify the expression you have entered, although it might not be able to do so if a database is included. The equals button leaves the expression in the display; one can add to it if so inclined. Starting a new expression, however, requires that one clear (CLR) the calculator first.
Buttons
The digits, decimal point, and +/- (change sign) are as in any normal calculator. Pi and e are constants. The lower right equals button simplifies expressions. CLR (clear) clears the machine and lets one start over. Parentheses ( "(" and ")" ) are as normal. The standard infix binary operators are as expected: +, -, *, /, ^ (x to the y). The HYP button changes trig functions to their hyperbolic version. The INV button changes many functions to inverse versions. A full table of functions follows:
Key Function INV HYP INV+HYP
sin Sine arc sin sinh arc sinh
cos Cosine arc cos cosh arc cosh
tan Tangent arc tan tanh arc tanh
ln Natural log ex    
log Log base 10 10x    
abs Absolute value      
rand Random number      
sqrt Square root x2    
1/x Reciprocal      
== Equality Test Not equals    
< Inequality Test >=    
> Inequality Test <=    

The inequality tests are infix operators and return 0 (false) or 1 (true). These are most convenient for comparing two databases or slices within the same database. For example, one can enter A==B and see exactly where two databases (or slices) are equal.

The random number function produces a single random number between zero and its argument. It will be evaluated immediately if its argument can be. In order to add random noise to a database, one must prevent its evaluation. rand(A==A) will do that conveniently.

Mem, Rcl, and Exch interact with a dynamic register in the calculator. They work just as typical calculator buttons do, except that they can handle whole expressions. "Mem" saves an expression into memory. "Rcl" recalls it, and "Exch" exchanges the contents of the current display with the saved one.

F1-5 are used to save expressions between sessions. The calculator has five memory slots. Hitting an F key recalls a saved expression; INV+F key saves an expression into a permanent register. F1-3 have some useful or interesting expressions already saved.

The "Deg" key is a toggle key that affects how trigonometric expressions are evaluated. "Deg" means trig arguments are evaluated in degrees; "Rad" means they are in radians. Hitting the key switches between the two modes.

The question mark key, just as in all other applications, gets a help screen.

Applications to Connect to This Application

Any Data Object may be connected via the "drag 'n drop" button to this application.

Applications to Connect This Application to

Currently, only Combine can use the calculator. Remember to hit Send to tell Combine that you are ready to use your new expression.

Tricks and Gotchas

To add five units of random noise to a database, do rand(A==A)*5+A.

To create a number in exponential notation, do number * exponent INV LOG, which produces number * 10^exponent.


WebWinds Home / Oct 5, 2001