xcalc(X) X Version 11 (11 July 1990) xcalc(X)
NAME
xcalc - scientific calculator for X
SYNOPSIS
xcalc [-options ...]
DESCRIPTION
The xcalc desktop accessory emulates the TI-30, the HP-10C,
and a slide rule.
OPTIONS
-help
Displays a list of the available options to xcalc.
-display displayname
Specifies the X server.
-geometry geometry
Specifies the size and placement of the top level
window. By default, the minimum size is used. Note
that your window manager may require you to place it
explicitly anyway.
-fg color
Specifies the foreground color. The default is
"black."
-bg color
Specifies the background color. The default is
"white."
-bw pixels
Specifies the border width in pixels. The default is
2.
-stip
Draws the background of the calculator using a stipple
of the foreground and background colors. On monochrome
displays this makes for a nicer display.
-rv Specifies reverse video.
-rpn Specifies Reverse Polish Notation. In this mode the
calculator looks and behaves like an HP-10C. Without
this flag, it emulates a TI-30.
-analog
Specifies a slide rule.
OPERATION
Mouse Usage: Most operations are done with button 1 (usually
left button on your mouse). The only exception is that
Page 1 (printed 7/3/90)
xcalc(X) X Version 11 (11 July 1990) xcalc(X)
pressing the AC key on the TI calculator with button 3
(usually on the right) exits the calculator.
Key Usage (Normal mode): The number keys, the +/- key, and
the +, -, *, /, and = keys all do exactly what you would
expect them to. It should be noted that the operators obey
the standard rules of precedence. Thus, entering 3+4*5=
results in 23, not 35. You can use the parentheses used to
override this. For example, (1+2+3)*(4+5+6)= results in
6*15=90. The non-obvious keys are detailed below.
1/x Replaces the number in the display with its reciprocal.
x^2 Squares the number in the display.
SQRT
Takes the square root of the number in the display.
CE/C
When pressed once, clears the number in the display
without clearing the state of the machine. Allows you
to re-enter a number if you make an error. Pressing it
twice clears the state.
AC Clears everything, the display, the state, and the
memory. Pressing it with the right button turns off the
calculator, in that it exits the program.
INV Inverts the meaning of the function keys. See the
individual function keys for details.
sin Computes the sine of the number in the display, as
interpreted by the current DRG mode (see DRG, below).
If inverted, it computes the arcsine.
cos Computes the cosine, or arccosine, when inverted.
tan Computes the tangent, or arctangent when inverted.
DRG Changes the DRG mode, as indicated by DEG, RAD or GRAD
at the bottom of number window of the calculator. When
in DEG mode, numbers in the display are taken as being
degrees. In RAD mode, numbers are in radians, and in
GRAD mode, numbers are in grads. When inverted, the DRG
key converts degrees to radians to grads and vice-versa.
For example: put the calculator into DEG mode and type 45
INV DRG. The display should now show something along the
lines of .785398, which is 45 degrees converted to radians.
e The constant "e" (2.7182818...)
Page 2 (printed 7/3/90)
xcalc(X) X Version 11 (11 July 1990) xcalc(X)
EE Enters exponential numbers. For example, to enter
-2.3E-4 type 2 . 3 +/- EE 4 +/-
log Calculates the log (base 10) of the number in the
display. When inverted, it raises 10.0 to the number in
the display. For example, typing 3 INV log results in
1000.
ln Calcuates the log (base e) of the number in the display.
When inverted, it raises "e" to the number in the
display. For example, typing e ln should result in 1.
y^x Raises the number on the left to the power of the number
on the right. For example 2 y^x 3 = results in 8, which
is 2^3. For a further example, (1+2+3) y^x (1+2) =
equals 6 y^x 3 which equals 216.
PI The constant "pi." (3.1415927....)
x! Computes the factorial of the number in the display.
The number in the display must be an integer in the
range 0-500, though, depending on your math library, it
might overflow long before that. (The maximum on UNIX
System V systems is 170.)
STO Copies the number in the display to the memory location.
RCL Copies the number from the memory location to the
display.
SUM Adds the number in the display to the number in the
memory location.
EXC Swaps the number in the display with the number in the
memory location.
Key Usage (RPN mode):
The number keys, CHS (change sign), +, -, *, /, and ENTR
keys all do exactly what you would expect them to do.
Many of the remaining keys are the same as in normal
mode. The differences are detailed below.
<- Backspace key that you can use while typing a number.
It erases digits from the display.
ON Clears everything, the display, the state, and the
memory. Pressing it with the right button turns off the
calculator, in that it exits the program.
INV Inverts the meaning of the function keys. This would be
the "f" key on an HP calculator, but xcalc does not
have the resolution to display multiple legends on each
Page 3 (printed 7/3/90)
xcalc(X) X Version 11 (11 July 1990) xcalc(X)
key. See the individual function keys for details.
10^x
Raises 10.0 to the number in the top of the stack. When
inverted, it calculates the log (base 10) of the number
in the display.
e^x Raises "e" to the number in the top of the stack. When
inverted, it calcuates the log (base e) of the number in
the display.
STO Copies the number in the top of the stack to a memory
location. There are 10 memory locations. The desired
memory is specified by following this key with a digit
key.
RCL Pushes the number from the specified memory location
onto the stack.
SUM Adds the number on top of the stack to the number in the
specified memory location.
x:y Exchanges the numbers in the top two stack positions.
R v Rolls the stack downward. When inverted, it rolls the
stack upward.
blank
These keys were used for programming functions on the
HP11-C. The xcalc program does not duplicate their
functionality.
KEYBOARD EQUIVALENTS
If you have the pointer in the xcalc window, you can use the
keyboard to speed entry, since almost all of the calculator
keys have a keyboard equivalent. The number keys, the
operator keys, and the parentheses all have the obvious
equivalent. The less-obvious equivalents follow:
n: +/- !: x!
p: PI e: EE
l: ln ^: y^x
i: INV s: sin
c: cos t: tan
d: DRG BS, DEL: CE/C (<- in RPN mode)
CR: ENTR q: quit
In non-analog mode, you can also quit by pressing Ctrl-C in |
the window.
COLOR USAGE
The xcalc program can use many colors. The default uses two
Page 4 (printed 7/3/90)
xcalc(X) X Version 11 (11 July 1990) xcalc(X)
colors (foreground and background) for everything. This
works out nicely. However, if you want to use more colors,
you can specify colors for the number keys, the operator
(+-*/=) keys, the function keys, the display, and the icon.
X DEFAULTS
BorderWidth
Specifies the width of the border. The default is 2.
ReverseVideo
Specifies reverse video.
Stipple
Specifies a stippled background. The default is "on"
for monochrome displays, and "off" for color displays.
Mode Specifies the default mode. Allowable values are rpn,
analog.
Foreground
Specifies the default color for borders and text.
Background
Specifies the default color for the background.
NKeyFore, NKeyBack
Specifies the colors for the number keys.
OKeyFore, OKeyBack
Specifies the colors for the operator keys.
FKeyFore, FKeyBack
Specifies the colors for the function keys.
DispFore, DispBack
Specifies the colors for the display.
IconFore, IconBack
Specifies the colors for the icon.
EXAMPLES
If you are running xcalc on a monochrome display, you
shouldn't need any .Xdefaults entries for xcalc. On a color
display, you might want to try the following in normal mode:
xcalc.Foreground: Black
xcalc.Background: LightSteelBlue
xcalc.NKeyFore: Black
xcalc.NKeyBack: White
xcalc.OKeyFore: Aquamarine
xcalc.OKeyBack: DarkSlateGray
xcalc.FKeyFore: White
Page 5 (printed 7/3/90)
xcalc(X) X Version 11 (11 July 1990) xcalc(X)
xcalc.FKeyBack: #900
xcalc.DispFore: Yellow
xcalc.DispBack: #777
xcalc.IconFore: Red
xcalc.IconBack: White
SEE ALSO
X(X)
xrdb(X)
LIMITATIONS
The calculator does not resize.
The slide rule and HP mode may not work correctly.
COPYRIGHT
Copyright 1988, Massachusetts Institute of Technology.
See X(X) for a full statement of rights and permissions.
AUTHORS
John Bradley, University of Pennsylvania; Mark Rosenstein,
MIT Project Athena.
Page 6 (printed 7/3/90)