Fix errors from make distcheck
[gcalctool.git] / data / gcalctool.1
blobc3cb2e49b745c3602ffede52bec7db87b7e6eb10
1 .\" Copyright (c) 1987-2008 - Sun Microsystems, Inc.
2 .TH gcalctool 1 "1 January 2008"
3 .SH NAME
4 gcalctool \- a desktop calculator
5 .SH SYNOPSIS
6 .B gcalctool
8 .B -D
9 ] [
10 .B -E
11 ] [
12 .B -a
13 .I accuracy
14 ] [
15 .B -v
16 ] [
17 .B \-?
19 .SH DESCRIPTION
20 .B gcalctool
21 is a desktop calculator. It has been designed to be used with
22 either the mouse or the keyboard. It is visually similar to a lot of
23 hand-held calculators. There are basic, financial and scientific modes.
24 Some of the calculator keys have menu marks. This indicates that there 
25 is a menu associated with that key. Each key is discussed in more 
26 detail below.
27 .LP
28 One of the most important things to remember about
29 .B gcalctool
30 is that calculations are performed from left to right, with no arithmetic
31 precedence. If you need arithmetic precedence, then you should use
32 parentheses (see below).
33 .LP
34 Internal arithmetic is now done with multi-precision floating point numbers.
35 Accuracy can be adjusted from zero to nine numeric places in fixed notation,
36 but numbers can be displayed in engineering and scientific notation as well.
37 There is also an option to show or remove trailing zeroes after the numeric
38 point.
39 The calculator reverts to scientific notation when the number is larger than
40 the display would allow in fixed notation. In the scientific mode, the base 
41 of operation can be changed between binary, octal, decimal and hexadecimal.
42 Numbers are initially displayed in fixed notation to nine numeric places,
43 with trailing zeroes removed, in the decimal base.
44 .LP
45 You can use the
46 .I Copy
47 and
48 .I Paste
49 functions in conjunction with the numeric display to store or
50 retrieve characters from the clipboard. You can also remove the last digit
51 entered, completely clear the displayed entry and totally reset the 
52 calculator.
53 .LP
54 There are ten memory registers. Numbers can be stored or retrieved in these
55 locations, and arithmetic can be performed upon register contents.
56 .LP
57 On startup,
58 .B gcalctool
59 will use several configuration resources stored in a 
60 .I gconf
61 database. These are listed in detail in the resources section of these 
62 manual pages. Any constants or function definitions that the user defines are
63 also stored in this database.
64 .LP
65 Context sensitive help is also available. Control-F1 toggles whether
66 tooltip help is displayed for the item which currently has focus.
67 .SH OPTIONS
68 .TP
69 .B \-D
70 Turning on gcalctool debugging.
71 .TP
72 .B \-E
73 Turning on debugging in the multiple precision arithmetic package.
74 .TP
75 .BI \-a " accuracy"
76 Initial number of digits displayed after the numeric point. This value must
77 be in the range 0 to 9. The default is nine numeric places.
78 .TP
79 .B \-v
80 Show the version number and the usage message of this release of the
81 .B gcalctool
82 program.
83 .TP
84 .B \-?
85 Show the version number and the usage message of this release of the
86 .B gcalctool
87 program. Note that the
88 .B ?
89 character must be escaped if using
90 .BR csh (1).
91 .SH RESOURCES
92 On startup,
93 .B gcalctool
94 uses the following string type resources stored in a 
95 .I gconf
96 database:
97 .TP 15
98 .PD 0
99 .B Resource:
100 /apps/gcalctool/accuracy
102 .B Values:
103 Accuracy value
105 .B Description
106 The number of of digits displayed after the numeric point. This value must
107 be in the range 0 to 9.
110 .B Resource:
111 /apps/gcalctool/base
113 .B Values:
114 Numeric Base
116 .B Description
117 The initial numeric base. Valid values are "BIN" (binary), "OCT" (octal), 
118 "DEC" (decimal) and "HEX" (hexadecimal).
121 .B Resource:
122 /apps/gcalctool/display
124 .B Values:
125 Display mode
127 .B Description
128 The initial display mode. Valid values are "ENG" (engineering), "FIX"
129 (fixed-point) and "SCI" (scientific).
132 .B Resource:
133 /apps/gcalctool/mode
135 .B Values:
136 Mode
138 .B Description
139 The initial calculator mode. Valid values are "BASIC", "FINANCIAL"
140 and "SCIENTIFIC".
143 .B Resource:
144 /apps/gcalctool/showzeroes
146 .B Values:
147 true, false (true)
149 .B Description
150 Whether trailing zeroes, after the numeric point, are shown in the
151 display value.
154 .B Resource:
155 /apps/gcalctool/showthousands
157 .B Values:
158 true, false (false)
160 .B Description
161 Whether fixed numbers in the decimal base are displayed with thousands
162 separated.
165 .B Resource:
166 /apps/gcalctool/showregisters
168 .B Values:
169 true, false (true)
171 .B Description
172 Whether the memory register window is initially displayed.
175 .B Resource:
176 /apps/gcalctool/trigtype
178 .B Values:
179 Trig. type
181 .B Description
182 The initial trigonometric type. Valid values are "DEG" (degrees), 
183 "GRAD" (grads) and "RAD" (radians).
185 .SH MENU BAR
188 This section describes the menu items available in the applications menubar.
189 .SS Calculator Menu
191 .PD 0
192 .IP "\fBQuit    [ Control-Q ]\fP" 18
193 Exit without user verification.
194 .SS Edit Menu
196 .PD 0
197 .IP "\fBCopy    [ Control-C ]\fP" 18
198 Copy the calculators numeric display to the clipboard.
199 .IP "\fBPaste   [ Control-V ]\fP" 18
200 Paste the contents of the clipboard into the calculators numeric display.
201 .IP "\fBInsert ASCII Value      [ Control-I ]\fP" 18
202 A separate window is displayed which allows you to enter any character. 
203 The ASCII value of this character is then displayed in the current base.
204 .SS View Menu
206 .PD 0
207 .IP "\fBBasic Mode    [ Control-B ]\fP" 18
208 Display the calculator in basic mode.
209 .IP "\fBFinancial Mode    [ Control-F ]\fP" 18
210 Display the calculator in financial mode.
211 .IP "\fBScientific Mode    [ Control-S ]\fP" 18
212 Display the calculator in scientific mode.
213 .IP "\fBMemory Registers    [ Control-M ]\fP" 18
214 Display the memory registers window.
215 .SS Help Menu
217 .PD 0
218 .IP "\fBContents...    [ F1 ]\fP" 18
219 Display the online help for the calculator in a separate window.
220 .IP "\fBAbout Gcalctool    [ Control-A ]\fP" 18
221 Display information about this application, including the version number
222 and the author.
223 .SH CALCULATOR BUTTONS
226 This section describes the calculator keys present in the main
227 .B gcalctool
228 window. 
229 .B gcalctool
230 has three modes; basic, financial and scientific. The keys associated with
231 each of these modes are described in separate sections below.
233 Keyboard equivalents appear in the square brackets. Note that Alt followed
234 by a letter indicates that the Alt key and this key should be pressed
235 together.
236 .SH BASIC MODE
239 .SS "Numerical Keys [ 0-9 . = <Return> ]."
241 Enter a digit (decimal digits 0-9) into the display. The '.' character acts 
242 as the numeric point, and '=' (or Return) is used to complete numerical entry.
244 Upto forty digits may be entered.
245 .SS "Arithmetical Operations [ + - x * / ]."
247 Perform an arithmetical operation using the previous entry and the next entry
248 as operands. Addition, subtraction, multiplication and division are denoted by
249 the characters '+', '-', '*' and '/' respectively ('x' is also synonymous with
250 multiplication).
251 .SS Number Manipulation Operators.
253 .PD 0
254 .IP "\fBInt     [ i ]\fP" 18
255 Return the integer portion of the current entry.
256 .IP "\fBFrac    [ : ]\fP" 18
257 Return the fractional portion of the current entry.
258 .IP "\fBAbs     [ u ]\fP" 18
259 Return the absolute value of the current entry.
260 .IP "\fB+/-     [ C ]\fP" 18
261 Change the arithmetic sign of the current entry.
262 .IP "\fB1/x     [ r ]\fP" 18
263 Return the value of 1 divided by the current entry.
264 .IP "\fBx^2     [ @ ]\fP" 18
265 Return the square of the current entry.
266 .IP "\fB%       [ % ]\fP" 18
267 Perform a percentage calculation using the last entry and the next entry.
268 .IP "\fBSqrt    [ s ]\fP" 18
269 Perform a square root operation on the current entry.
271 .SS Menu Operations.
273 Each of these operations has a popup menu associated with it.
274 It is also possible to use just the keyboard to achieve the same results.
275 The first keyboard value selects the menu operation; the second keyboard
276 character selects the new value for this operation. Unlike the menu facility
277 available with the mouse, there is no visual feedback on what choices are
278 available to you, so the user has to know what item they wish to select.
279 .PD 0
280 .IP "\fBAcc     [ A ]\fP" 18
281 Set the display accuracy. Between 0 and 9 [ 0-9 ] significant digits can be
282 displayed.
283 .IP "\fBRcl     [ R ]\fP" 18
284 Retrieve memory register value. There are ten memory registers [\ 0-9\ ].
285 .IP "\fBSto     [ S ]\fP" 18
286 Store value in memory register. There are ten memory registers [\ 0-9\ ].
287 The register number may be preceded by an arithmetic operation (addition,
288 subtraction, multiplication or division), in which case the specified
289 operation is carried out between the displayed entry and the value currently
290 in the selected memory register, and the result is placed in the memory
291 register.
292 .IP "\fBExch    [ X ]\fP" 18
293 Exchange the current display with the contents of a memory register. There
294 are ten memory registers [ 0-9 ].
295 .SS Other Operations.
297 .IP "\fBClr     [ Delete ]\fP" 18
298 Clear the display, and reset the calculator.
299 .IP "\fBCE      [ Control-Back Space or Escape ]\fP" 18
300 Clear the display.
301 .IP "\fBBksp    [ Back Space ]\fP" 18
302 Remove the rightmost character of the current entry, and recalculate the
303 displayed value.
305 .SH FINANCIAL MODE
307 An example of how to use each of these financial calculations, is available
308 via the tooltip help facility.
309 .PD 0
310 .IP "\fBCtrm    [ m ]\fP" 18
311 Compounding term. Computes the number of compounding periods it will take an
312 investment of present value pv to grow to a future value of fv, earning a
313 fixed interest rate int per compounding period.
316 Memory register usage:
318 Register 0      int     (periodic interest rate).
320 Register 1      fv      (future value).
322 Register 2      pv      (present value).
323 .IP "\fBDdb     [ D ]\fP" 18
324 Double-declining depreciation. Computes the depreciation allowance on an
325 asset for a specified period of time, using the double-declining balance
326 method.
328 Memory register usage:
330 Register 0      cost    (amount paid for asset).
332 Register 1      salvage (value of asset at end of life).
334 Register 2      life    (useful life of the asset).
336 Register 3      period  (time period for depreciation allowance).
337 .IP "\fBFv      [ v ]\fP" 18
338 Future value. This calculation determines the future value of an investment.
339 It computes the future value based on a series of equal payments, each of
340 amount pmt, earning periodic interest rate int, over the number of payment
341 periods in term.
343 Memory register usage:
345 Register 0      pmt     (periodic payment).
347 Register 1      int     (periodic interest rate).
349 Register 2      n       (number of periods).
350 .IP "\fBPmt     [ P ]\fP" 18
351 Periodic payment. Computes the amount of the periodic payment of a loan.
352 Most installment loans are computed like ordinary annuities, in that payments
353 are made at the end of each payment period.
355 Memory register usage:
357 Register 0      prin    (principal).
359 Register 1      int     (periodic interest rate).
361 Register 2      n       (term).
362 .IP "\fBPv      [ p ]\fP" 18
363 Present value. Determines the present value of an investment. It computes
364 the present value based on a series of equal payments, each of amount pmt,
365 discounted at periodic interest rate int, over the number of periods in term.
367 Memory register usage:
369 Register 0      pmt     (periodic payment).
371 Register 1      int     (periodic interest rate).
373 Register 2      n       (term).
374 .IP "\fBRate    [ T ]\fP" 18
375 Periodic interest rate. Returns the periodic interest necessary for a present
376 value of pv to grow to a future value of fv over the number of compounding
377 periods in term.
379 Memory register usage:
381 Register 0      fv      (future value).
383 Register 1      pv      (present value).
385 Register 2      n       (term).
386 .IP "\fBSln     [ l ]\fP" 18
387 Straight-line depreciation. Computes the straight-line depreciation of an
388 asset for one period. The straight-line method of depreciation divides the
389 depreciable cost (cost - salvage) evenly over the useful life of an asset.
390 The useful life is the number of periods (typically years) over which an
391 asset is depreciated.
393 Memory register usage:
395 Register 0      cost    (cost of the asset).
397 Register 1      salvage (salvage value of the asset).
399 Register 2      life    (useful life of the asset).
400 .IP "\fBSyd     [ Y ]\fP" 18
401 Sum-of-the-years-digits depreciation. The sum-of-the-years'-digits method
402 of depreciation accelerates the rate of depreciation, so that more
403 depreciation expense occurs in earlier periods than in later ones. The
404 depreciable cost is the actual cost minus salvage value. The useful life is
405 the number of periods (typically years) over which an asset is depreciated.
407 Memory register usage:
409 Register 0      cost    (cost of the asset).
411 Register 1      salvage (salvage value of the asset).
413 Register 2      life    (useful life of the asset).
415 Register 3      period  (period for which depreciation is computed).
416 .IP "\fBTerm    [ t ]\fP" 18
417 Payment period. Returns the number of payment periods in the term of an
418 ordinary annuity necessary to accumulate a future value of fv, earning a
419 periodic interest rate of int. Each payment is equal to amount pmt.
421 Memory register usage:
423 Register 0      pmt     (periodic payment).
425 Register 1      fv      (future value).
427 Register 2      int     (periodic interest rate).
429 .SH SCIENTIFIC MODE
432 This section describes the functionality available in the calculators
433 scientific mode. This also includes a special mode panel used for setting
434 various options.
435 .SS Mode Panel.
438 .IP "\fBNumeric Base\fP" 18
439 Set the numeric base of operation. Choices are binary, octal, decimal (the
440 default) and hexadecimal.
441 .IP "\fBDisplay Type\fP" 18
442 Set the display mode. Valid values are "Eng" (engineering), "Fix"
443 (fixed-point) and "Sci" (scientific).
444 .IP "\fBTrigonometric Type\fP" 18
445 Set the trigonometric type. Valid values are Degrees, Gradians and Radians.
446 .IP "\fBHyp\fP" 18
447 Toggle the hyperbolic function indicator. This switch affects the type of
448 sine, cosine and tangent trigonometric functions performed.
449 .IP "\fBInv\fP" 18
450 Toggle the inverse function indicator. This switch affects the type of sine,
451 cosine and tangent trigonometric functions performed.
453 .SS Menu Operations.
455 .PD 0
456 .IP "\fBCon     [ # ]\fP" 18
457 Retrieve and display a constant value. There are ten constant values [ 0-9 ],
458 and each one has a default value which can be overridden when the user creates
459 their own constant definitions. The ten default values are:
461 0       0.621           kilometers per hour or miles per hour
463 1       1.414213562     square root of 2
465 2       2.718281828     e
467 3       3.141592653     pi
469 4       0.3937007       centimeters or inches
471 5       57.295779513    degrees in a radian
473 6       1048576.0       2 to the power of 20
475 7       0.0353          grams or ounces
477 8       0.948           kilojoules or British thermals
479 9       0.0610          cubic centimeters or cubic inches
480 .IP "\fBFun     [ F ]\fP" 18
481 Retrieve and execute a function expression. There can be upto ten functions
482 expression defined by the user [0 - 9]. There are no default function values.
484 .SS Scientific buttons.
485 .PD 0
487 .IP "\fB<       [ < ]\fP" 18
488 Shift the current entry to the left. The shift can be between 1 and 15 places
489 [ 1-9, A-F ]. This calculator key has a popup menu associated with it.
490 .IP "\fB>       [ > ]\fP" 18
491 Shift the current entry to the right. The shift can be between 1 and 15 places
492 [ 1-9, A-F ]. This calculator key has a popup menu associated with it.
493 .IP "\fB&16     [ ] ]\fP" 18
494 Truncate the current entry to a 16 bit unsigned integer.
495 .IP "\fB&32     [ [ ]\fP" 18
496 Truncate the current entry to a 32 bit unsigned integer.
497 .IP "\fB( and ) [ ( and ) ]\fP" 18
498 Parentheses. Allow precedence with arithmetic calculations. Note that
499 parentheses can be nested to any level, and
500 .B gcalctool
501 provides a visual feedback of what is being typed in, in the calculator
502 display. The calculation doesn't take place until the last parenthesis is
503 matched, then the display is updated with the new result.
504 .IP "\fBExp     [ E ]\fP" 18
505 This is used to allow numbers to be entered in scientific notation. The
506 mantissa should be initially entered, then the Exp key selected. The exponent
507 is then entered. If no numerical input had occurred when the Exp key was
508 selected, then a mantissa of 1.0 is assumed.
509 .IP "\fBe^x     [ { ]\fP" 18
510 Returns e raised to the power of the current entry.
511 .IP "\fB10^x    [ } ]\fP" 18
512 Returns 10 raised to the power of the current entry.
513 .IP "\fBy^x     [ y ]\fP" 18
514 Take the last entry and raise it to the power of the next entry.
515 .IP "\fBx!      [ ! ]\fP" 18
516 Return the factorial of the current entry. Note that the factorial function
517 is only valid for positive integers.
518 .IP "\fBRand    [ ? ]\fP" 18
519 Return a random number between 0.0 and 1.0.
520 .IP "\fBHexadecimal Keys [ a-f ]\fP" 18
521 The hexadecimal numerical digits A-F. These buttons will be insensitive 
522 unless the calculator is currently in the hexadecimal mode. They will be
523 shown in upper-case in the calculator display.
524 .IP "\fBCos     [ J ]\fP" 18
525 Return the trigonometric cosine, arc cosine, hyperbolic cosine or inverse
526 hyperbolic cosine of the current display, depending upon the current
527 settings of the hyperbolic and inverse function switches. The result is
528 displayed in the current trigonometric units (degrees, radians or grads).
529 .IP "\fBSin     [ K ]\fP" 18
530 Return the trigonometric sine, arc sine, hyperbolic sine or inverse
531 hyperbolic sine of the current display, depending upon the current settings
532 of the hyperbolic and inverse function switches. The result is displayed in
533 the current trigonometric units (degrees, radians or grads).
534 .IP "\fBTan     [ L ]\fP" 18
535 Return the trigonometric tangent, arc tangent, hyperbolic tangent or inverse
536 hyperbolic tangent of the current display, depending upon the current
537 settings of the hyperbolic and inverse function switches. The result is
538 displayed in the current trigonometric units (degrees, radians or grads).
539 .IP "\fBLn      [ N ]\fP" 18
540 Return the natural logarithm of the current entry.
541 .IP "\fBLog10   [ G ]\fP" 18
542 Return the base 10 logarithm of the current entry.
543 .IP "\fBLog2    [ H ]\fP" 18
544 Return the base 2 logarithm of the current entry.
545 .IP "\fBOR      [ | ]\fP" 18
546 Perform a logical OR operation on the current entry and the next entry,
547 .IP "\fBAND     [ & ]\fP" 18
548 Perform a logical AND operation on the current entry and the next entry,
549 treating both numbers as unsigned long integers.
550 .IP "\fBNOT     [ ~ ]\fP" 18
551 Perform a logical NOT operation on the current entry.
552 .IP "\fBXOR     [ ^ ]\fP" 18
553 Perform a logical XOR operation on the current entry and the next entry,
554 treating both numbers as unsigned long integers.
555 .IP "\fBXNOR    [ n ]\fP" 18
556 Perform a logical XNOR operation on the current entry and the next entry,
557 treating both numbers as unsigned long integers.
559 .SH FILES
560 .PD 0
561 .TP 18
562 .B ~/.gcalctoolrc
563 user's personal gcalctool resources for customizing the appearance and color of
564 .B gcalctool