CALCTOOL(1L)

NAME
calctool - window based calculator for the Sun workstation

SYNOPSIS
calctool [ -h helpfile ] [ -v ] [ -? ]

DESCRIPTION
Calctool is a window based calculator for the Sun. It receives input via the mouse or the keyboard. Each calculator button has two functions associated with it.

Internal arithmetic is done with double precision floating point numbers. Accuracy can be adjusted from zero to nine numeric places, and the base of operation can be binary,octal,decimal or hexidecimal. Numbers are initially displayed to two numeric places, in decimal base.

The numeric display can be adjusted using the SunView Put and Get function keys. The previous digit entered can be removed and the whole display cleared.

There are ten memory registers; numbers can be retrieved or stored in these locations, and arithmetic can be performed upon register contents.

In addition to the current numerical value, the display window contains the current base and the current trigonometrical units. If an operation needing more than one numerical input is partially complete, the operation is also displayed in this window as a reminder.

The calculator has arithmetical, logical and trigonometrical functions. These are grouped together and color coded on color workstations.

Online help is provided via a help button. Select this button, and then the function you wish to be described.

OPTIONS

-h helpfile
    Use an alternate helpfile.

-v  Print the version number of this release of the calctool program.

-?  Print the usage line for this program. Note that the ? character should be escaped if running from csh(1).

CALCULATOR BUTTONS
[Keyboard equivalents appear in brackets]

  Numerical Keys [0-9 a-f . = <RETURN>].

Enter a digit (decimal digits 0-9 or hexidecimal digits A-F) in the display. The . acts as the decimal point and = is used for completion of numerical entry (<RETURN> can be also be used from the keyboard to terminate numerical entry).

  Arithmetical Operations [+ - x X * /].

Perform an arithmetical operation using the preivous entry and the next entry as operands. Addition, subtraction, multiplication and division are denoted by the buttons +, -, x and / respectively (the keyboard keys * and X are synonymous with x for multiplication).

  Base Changes.

BIN  [ B ]
    Change display base to binary (maximum: 32 digits).

OCT  [ O ]
    Change display base to octal (maximum: 15 digits). are allowed.

DEC  [ D ]
    Change display base to decimal (default; maximum: 12 digits).

HEX  [ H ]
    Change display base to hexidecimal (maximum: 12 digits).

  Trigonometric Unit Changes.

DEG  [ ^d ]
    Change current trigonometrical base to degrees.

RAD  [ ^r ]
    Change the current trigonometrical base to radians.

GRAD [ ^g ]
    Change the current trigonometrical base to gradients.

  Logical Operations.

AND  [ & ]
    Perform a logical AND operation on the current entry and the next entry, treating both numbers as unsigned long integers.

NOT  [ ~ ]
    Perform the logical NOT operation of the current entry.

OR   [ | ]
    Perform a logical OR operation on the current entry and the next entry, treating both numbers as unsigned long integers.

XNOR [ n or N ]
    Perform a logical XNOR operation on the current entry and the next entry, treating both numbers as unsigned long integers.

XOR  [ ^ ]
    Perform a logical XOR operation on the current entry and the next entry, treating both numbers as unsigned long integers.

  Trigonometrical Operators.

ASIN [ } ]
    Return the trigonometric Arc Sin of the current entry, in the current units (degrees, radians or gradients).

SIN  [ { ]
    Return the trigonometric Sin of the current entry, in the current units (degrees, radians or gradients).

ACOS [ ) ]
    Return the trigonometric Arc Cos of the current entry, in the current units (degrees, radians or gradients).

COS  [ ( ]
    Return the trigonometric Cos of the current entry, in the current units (degrees, radians or gradients).

ATAN [ T ]
    Return the trigonometric Arc Tan of the current entry, in the current units (degrees, radians or gradients).

TAN  [ t ]
    Return the trigonometric Tan of the current entry, in the current units (degrees, radians or gradients).

  Memory Register Operators.

RCL  [ r ]
    Retrieve memory register n. This selection must be followed by a digit in the range 0 to 9 to indicate a memory register.

STO  [ s ]
    Store memory register n. This must be followed by a digit in the range 0 to 9 to indicate a memory register. The register number may be preceded by an arithmetic operation (addition, subtraction, multiplication or division), in which case the specifed operation is carred out between the displayed entry and the value currently in register n, and the result is placed in register n.

  Constants.

PI   [ P ]
    Enter the value of pi.

e    [ E ]
    Enter the value of e.

  Mathematical Operators.

%    [ % ]
    Perform a percentage calculation using the last entry and the next entry.

e^x  [ # ]
    Return e raised to the power of the current entry.

10^x [ $ ]
    Return 10 raised to the power of the current entry.

y^x  [ Y ]
    Take the last entry and raise it to the power of the next entry.

ln   [ N ]
    Return the natural logarithm of the current entry.

log  [ G ]
    Returns the base 10 logarithm of the current entry.

SQRT [ S ]
    Perform a square root operation on the current entry.

1/x  [ R ]
    Return the value of 1 divided by the current entry.

x!   [ ! ]
    Return the factorial of the current entry.

x^2  [ @ ]
    Return the square of the current entry.

  Number Manipulation Operators.

<    [ < ]
    Left shift n places. This must be followed by a digit in the range 0 to 9 to indicate the number of places to shift.

>    [ > ]
    Right shift n places. This must be followed by a digit in the range 0 to 9 to indicate the number of places to shift.

&32  [ i ]
    Truncate the current entry to a 32 bit unsigned integer (logical function).

&16  [ h ]
    Truncate the given number to a 16 bit unsigned integer (logical function).

clr  [ Delete ]
    Clear the calculator display.

bsp  [ BackSpace ]
    Remove the rightmost character of the current entry and recalculate the the displayed value (note: internal accuracy is lost with this operation).

INT  [ I ]
    Return the integer portion of the current entry.

FRAC [ F ]
    Return the fractional portion of the current entry.

ACC  [ A ]
    Set accuracy. This must be followed by a digit in the range 0 to 9 to indicate how many digits are to be displayed.

CHS  [ C ]
    Change the arithmetic sign of the current entry.

ABS  [ U ]
    Return the absolute value of the current entry.

  Other keys.

MEM  [ M ]
    Toggle the display of the popup register window. Values of the ten memory registers are displayed in the current base, to the current accuracy.

KEYS [ K ]
    Toggle the labels on the calctool buttons between mouse and keyboard equivalents.

?    [ ? ]
    Display a help message for a particular button. First select this key, then the key to be described.

QUIT [q or Q]
    Exit (without user verification).

OFF  [ o ]
    Change calctool to an icon.

FILES

/usr/local/lib/calctool.help

BUGS
Parsing of the online help file is very primative.

Handling of errors generated by the mathematical routines is poorly done.

AUTHOR
Rich Burridge, Sun Microsystems, Unit 2, 49-53 Hotham Pde, Artarmon, N.S.W. 2164, AUSTRALIA. PHONE: +61 2 436 4699
JANET: richb%sunaus.oz@uk.ac.ucl.cs
ACSnet:  richb@sunaus.oz
UUCP: {uunet,hplabs,mcvax,ukc}!munnari!sunaus.oz!richb
ARPAnet: rburridge@Sun.COM
Manual page modified by R. P. C. Rodgers, UCSF School of Pharmacy, San Francisco, CA 94143.