1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
|
.\" @(#)calctool.1 1.8 89/12/13
.TH CALCTOOL 1x "13 December 1989"
.SH NAME
calctool \- a simple calculator
.SH SYNOPSIS
.B "calctool
[
.B -a
.I accuracy
]
[
.B -d
.I display
]
[
.B -g
.I geometry
]
[
.B -h
.I helpfile
]
[
.B -i
]
[
.B -v
]
[
.B \-Wi
]
[
.B \-Wp
.I x y
]
[
.B \-WP
.I x y
]
.SH DESCRIPTION
.I Calctool
is a simple calculator. It contains graphical interfaces for MGR, NeWS,
SunView, X11 and XView, as well as being able to function on normal display
terminals using a termcap interface. It can receive input via the keyboard,
or the mouse where applicable. Each calculator button has two functions
associated with it.
.LP
Internal arithmetic is done with double precision floating point numbers.
Accuracy can be adjusted from zero to nine numeric places in fixed notation,
but numbers can be displayed in scientific notation as well. The calculator
reverts to scientific notation when the number is larger than the display
would allow in fixed notation. The base of operation can be changed between
binary, octal, decimal and hexidecimal. Numbers are initially displayed in
fixed notation to two numeric places, in the decimal base.
.LP
You can use the SunView / XView
.I Put
and
.I Get
function keys in conjunction with the numeric display to store or retrieve
characters from the text shelf. The previous digit entered can be removed
and the whole display cleared.
.LP
There are ten memory registers; numbers can be retrieved or stored in
these locations, and arithmetic can be performed upon register contents.
.LP
The display windows contains the current numerical value plus the current
base and trigonometric type. There are also indicators which show if the
hyperbolic and inverse function switches are set, and which numerical mode
is currently in operation. If an operation needing more than one numerical
input is partially complete, the operation is also displayed in this window
as a reminder.
.LP
The calculator has arithmetical, logical and trigonometrical functions.
These are grouped together and color coded on color workstations.
.LP
With the SunView and XView versions, there is support for popup menus with
the right mouse button. Only certain buttons which have multiple options
have this ability. These are the ACC, CON, EXCH, FUN, <, >, RCL and STO keys.
.LP
Online help is provided via a help button. Select this button, and then
the function you wish to be described. The calctool windows can be redrawn
by typing ^L (control-l). This is very useful with the tty version after
somebody has written system messages all over your screen.
.LP
On startup,
.I calctool
will look for a
.I .calctoolrc
file in the users' home directory. This file allows the user to define
their own constants and function definitions. It then looks for a
.I .calctoolrc
file in the current directory. With the
.I .calctoolrc
file, there are currently four valid record types; comments, constants,
function definitions and initial memory register values.
.LP
Lines starting with a '#' are treated as comments and ignored.
.LP
Lines starting with 'c' or 'C' in the first column are definitions for
constants. The cC is followed by a digit in the range 0-9, then a space.
This is followed by a number in fixed or scientific notation. Following
this is an optional comment, which if found, will be used in the popup
menu for the constants. If the comment is present, then there must be at
least one space between this and the preceding number.
.LP
Lines starting with 'f' or 'F' in the first column are definitions
for functions. The fF is followed by a digit in the range 0-9, then a
space. This is followed by a function definition. Following this is an
optional comment, which if found, will be used in the popup menu for the
functions. If the comment is present, then there must be at least one
space between this and the preceding function definition.
.LP
Lines starting with 'r' or 'R' in the first column are definitions
for the initial contents of the memory registers. The rR is followed
by a digit in the range 0-9, then a space. This is followed by a number
in fixed or scientific notation. The rest of the line is ignored.
.LP
All other lines are ignored. There should be no embedded spaces in the
function definitions. Whenever a backslash is found, this and the following
character signify a control character, for example \\g would be ASCII 7.
.SH OPTIONS
.TP
.BI \-a " accuracy"
Initial number of significant digits displayed. This value must be in
the range 0 to 9. If not specified, this value defaults to 2.
.TP
.BI \-d " display"
Used with the X11 variant of calctool to give a display type.
.TP
.BI \-g " geometry"
Used with the X11 variant of calctool to give geometry information.
.TP
.BI \-h " helpfile"
Use an alternate helpfile.
.TP
.B \-i
Invert the calctool window before displaying it. For use by people who
started their graphics environment in inverse mode.
.TP
.B \-v
Print the version number of this release of the
.B calctool
program.
.TP
.B \-Wi
Start the
.B calctool
program up in iconic form. SunView automatically uses this flag, but the
NeWS version will also.
.TP
.BI \-Wp " x y"
Start the open window position at
.I x y
.TP
.BI \-WP " x y"
Start the icon position at
.I x y
.SH CALCULATOR BUTTONS
[Keyboard equivalents appear in brackets]
.SS "Numerical Keys [ 0-9 a-f . = <RETURN> ]."
.LP
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).
.SS "Arithmetical Operations [ + - x X * / ]."
.LP
Perform an arithmetical operation using the previous 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).
.SS Base Changes.
.LP
.IP "\fBBIN [ B ]\fP" 18
Change display base to binary (maximum: 32 digits).
.IP "\fBOCT [ O ]\fP" 18
Change display base to octal (maximum: 15 digits). are allowed.
.IP "\fBDEC [ D ]\fP" 18
Change display base to decimal (default; maximum: 12 digits).
.IP "\fBHEX [ H ]\fP" 18
Change display base to hexidecimal (maximum: 12 digits).
.SS Trigonometric Unit Changes.
.LP
.IP "\fBDEG [ ^d ]\fP" 18
Change current trigonometrical base to degrees.
.IP "\fBRAD [ ^r ]\fP" 18
Change the current trigonometrical base to radians.
.IP "\fBGRAD [ ^g ]\fP" 18
Change the current trigonometrical base to gradients.
.SS Logical Operations.
.LP
.IP "\fBAND [ & ]\fP" 18
Perform a logical AND operation on the current entry and the next entry,
treating both numbers as unsigned long integers.
.IP "\fBNOT [ ~ ]\fP" 18
Perform the logical NOT operation of the current entry.
.IP "\fBOR [ | ]\fP" 18
Perform a logical OR operation on the current entry and the next entry,
treating both numbers as unsigned long integers.
.IP "\fBXNOR [ n or N ]\fP" 18
Perform a logical XNOR operation on the current entry and the next entry,
treating both numbers as unsigned long integers.
.IP "\fBXOR [ ^ ]\fP" 18
Perform a logical XOR operation on the current entry and the next entry,
treating both numbers as unsigned long integers.
.SS Trigonometrical Operators.
.LP
.IP "\fBSIN [ ^s ]\fP" 18
Return the trigonometric sine, arc sine hyperbolic sine or inverse
hyperbolic sine of the current display, depending upon the current
settings of the hyperbolic and inverse function switches. The result
is displayed in the current trigonometric units (degrees, radians or
gradients).
.IP "\fBCOS [ ^c ]\fP" 18
Return the trigonometric cosine, arc cosine hyperbolic cosine or inverse
hyperbolic cosine of the current display, depending upon the current
settings of the hyperbolic and inverse function switches. The result
is displayed in the current trigonometric units (degrees, radians or
gradients).
.IP "\fBTAN [ ^t ]\fP" 18
Return the trigonometric tangent, arc tangent hyperbolic tangent or inverse
hyperbolic tangent of the current display, depending upon the current
settings of the hyperbolic and inverse function switches. The result
is displayed in the current trigonometric units (degrees, radians or
gradients).
.SS Memory Register Operators.
.LP
.IP "\fBRCL [ r ]\fP" 18
Retrieve memory register n. This selection must be followed by a digit
in the range 0 to 9 to indicate a memory register.
.IP "\fBSTO [ s ]\fP" 18
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.
.IP "\fBEXCH [ ^e ]\fP" 18
Exchange the current display with the contents of memory register n.
This selection must be followed by a digit in the range 0 to 9, to
indicate a memory register.
.SS Mathematical Operators.
.LP
.IP "\fB% [ % ]\fP" 18
Perform a percentage calculation using the last entry and the next entry.
.IP "\fBe^x [ { ]\fP" 18
Return e raised to the power of the current entry.
.IP "\fB10^x [ } ]\fP" 18
Return 10 raised to the power of the current entry.
.IP "\fBy^x [ Y ]\fP" 18
Take the last entry and raise it to the power of the next entry.
.IP "\fBln [ N ]\fP" 18
Return the natural logarithm of the current entry.
.IP "\fBlog [ G ]\fP" 18
Returns the base 10 logarithm of the current entry.
.IP "\fBSQRT [ S ]\fP" 18
Perform a square root operation on the current entry.
.IP "\fB1/x [ R ]\fP" 18
Return the value of 1 divided by the current entry.
.IP "\fBx! [ ! ]\fP" 18
Return the factorial of the current entry. Note that this only works
for positive integers.
.IP "\fBx^2 [ @ ]\fP" 18
Return the square of the current entry.
.SS Number Manipulation Operators.
.LP
.IP "\fB< [ < ]\fP" 18
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.
.IP "\fB> [ > ]\fP" 18
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.
.IP "\fB&32 [ [ ]\fP" 18
Truncate the current entry to a 32 bit unsigned integer
(logical function).
.IP "\fB&16 [ ] ]\fP" 18
Truncate the given number to a 16 bit unsigned integer
(logical function).
.IP "\fBclr [ Delete ]\fP" 18
Clear the calculator display.
.IP "\fBbsp [ BackSpace ]\fP" 18
Remove the rightmost character of the current entry
and recalculate the the displayed value (note: internal accuracy is
lost with this operation).
.IP "\fBINT [ I ]\fP" 18
Return the integer portion of the current entry.
.IP "\fBFRAC [ F ]\fP" 18
Return the fractional portion of the current entry.
.IP "\fBACC [ A ]\fP" 18
Set accuracy. This must be followed by a digit in the range 0 to 9 to
indicate how many digits are to be displayed.
.IP "\fBCHS [ C ]\fP" 18
Change the arithmetic sign of the current entry.
.IP "\fBABS [ U ]\fP" 18
Return the absolute value of the current entry.
.SS Other keys.
.LP
.IP "\fBMEM [ M ]\fP" 18
Toggle the display of the popup register window.
Values of the ten memory registers are displayed in the current
base, to the current accuracy.
.IP "\fBFIX / SCI [ ^n ]\fP" 18
Toggles the numerical display mode between fixed point and scientific
notation. This affects the current display and the contents of the
memory registers.
.IP "\fBCON [ # ]\fP" 18
Retrieve and display constant value n. This selection must be followed
by a digit in the range 0 to 9.
.br
The ten default constants are:
.sp
0 - kms per hour / miles per hour.
.br
1 - square root of 2.
.br
2 - e.
.br
3 - pi.
.br
4 - cms / inches.
.br
5 - degrees in a radian.
.br
4 - 2 ^ 20.
.br
6 - gms / oz.
.br
8 - kilojoules / British thermals.
.br
9 - cubic cms / cubic inches.
.IP "\fBHYP [ h ]\fP" 18
Set or unset the hyperbolic function indicator. This switch affects the
type of sine, cosine and tangent trigonometric functions performed.
.IP "\fBINV [ i ]\fP" 18
Set or unset the inverse function indicator. This switch affects the
type of sine, cosine and tangent trigonometric functions performed.
.IP "\fBKEYS [ K ]\fP" 18
Toggle the labels on the calctool buttons between mouse and
keyboard equivalents.
.IP "\fB? [ ? ]\fP" 18
Display a help message for a particular button. First select this key, then
the key to be described.
.IP "\fBQUIT [q or Q]\fP" 18
Exit (without user verification).
.IP "\fBOFF [ o ]\fP" 18
Change \fIcalctool\fP to an icon.
.SH FILES
.TP
/usr/X11R6/lib/X11/calctool.help
.TP
~/.calctoolrc
.SH BUGS
Handling of errors generated by the mathematical routines is poorly
done.
.SH AUTHOR
Rich Burridge, Domain: richb@sunaus.oz.au
.nf
PHONE: +61 2 413 2666 Path: {uunet,mcvax,ukc}!munnari!sunaus.oz!richb
.fi
.br
Original manual page modified by R. P. C. Rodgers, UCSF School of Pharmacy, San
Francisco, CA 94143.
|