hpcalc(1)

NAME
HP Calculator -- RPN based calculator

DESCRIPTION
The hpcalc macro is an attempt to emulate an HP calculator, hopefully to eventually contain many of the more sophisticated features. Currently, this calculator is simply an RPN based calculator similar to the calc macro. This calculator also supports floating point arithmetic as well as base conversions.

This macro displays a popup window, emulating the HP stack display. As numbers are typed in, and the <Enter> key is pressed, the numbers are pushed onto the calculation stack.

Typing an operator key causes the calculation to be performed straightaway. For example, to add two numbers together, type:
    '1' <Space> '2' '+'

(Thats four keystrokes - the number '1', the space bar, the number '2' and the plus key to add the numbers together.

The hpcalc macro supports octal, hexadecimal and decimal arithmetic. Non-decimal based numbers may be typed in using the 'C' notation (i.e. 0 followed by an octal number, or 0x followed by a hexadecimal one), or using the HP notation of a '#' character followed by the number and suffixed by a 'd', 'o', or 'h' character to indicate the base.

Base conversions are accomplished with the following commands: Convert binary number to real. Convert real number to binary in the current base.

The current base is set by typing one of: OCT - octal, DEC - decimal, HEX - hexadecimal, or BIN - binary (not currently supported).

Typing DEPTH pushes the current number of items on the stack onto the stack.

The calculator also supports the following trig and logarithmic functions:
    sin, cos, tan
    asin, acos, atan,
    sinh, cosh, tanh,
    sqrt,
    exp, log, log10

MENU/KEYS
This macro can be accessed from the CRISP features menu or by typing hpcalc at the command prompt.

BUGS
This calculator demonstrates the use of certain esoteric crunch language features. It is a very trivial calculator but useful. Needs a lot of work to compare to anybody elses.

All trig functions assume value is in radians.

Out of range for trig functions generate NaN numbers. Should really give complex results.