1gcalctool(1) General Commands Manual gcalctool(1)
2
3
4
6 gcalctool - a desktop calculator
7
9 gcalctool [ -D ] [ -E ] [ -a accuracy ] [ -v ] [ -? ]
10
12 gcalctool is a desktop calculator. It has been designed to be used with
13 either the mouse or the keyboard. It is visually similar to a lot of
14 hand-held calculators. There are basic, financial and scientific modes.
15 Some of the calculator keys have menu marks. This indicates that there
16 is a menu associated with that key. Each key is discussed in more
17 detail below.
18
19 One of the most important things to remember about gcalctool is that
20 calculations are performed from left to right, with no arithmetic
21 precedence. If you need arithmetic precedence, then you should use
22 parentheses (see below).
23
24 Internal arithmetic is now done with multi-precision floating point
25 numbers. Accuracy can be adjusted from zero to nine numeric places in
26 fixed notation, but numbers can be displayed in engineering and scien‐
27 tific notation as well. There is also an option to show or remove
28 trailing zeroes after the numeric point. The calculator reverts to
29 scientific notation when the number is larger than the display would
30 allow in fixed notation. In the scientific mode, the base of operation
31 can be changed between binary, octal, decimal and hexadecimal. Numbers
32 are initially displayed in fixed notation to nine numeric places, with
33 trailing zeroes removed, in the decimal base.
34
35 You can use the Copy and Paste functions in conjunction with the
36 numeric display to store or retrieve characters from the clipboard. You
37 can also remove the last digit entered, completely clear the displayed
38 entry and totally reset the calculator.
39
40 There are ten memory registers. Numbers can be stored or retrieved in
41 these locations, and arithmetic can be performed upon register con‐
42 tents.
43
44 On startup, gcalctool will use several configuration resources stored
45 in a gconf database. These are listed in detail in the resources sec‐
46 tion of these manual pages. Any constants or function definitions that
47 the user defines are also stored in this database.
48
49 Context sensitive help is also available. Control-F1 toggles whether
50 tooltip help is displayed for the item which currently has focus.
51
53 -D Turning on gcalctool debugging.
54
55 -E Turning on debugging in the multiple precision arithmetic pack‐
56 age.
57
58 -a accuracy
59 Initial number of digits displayed after the numeric point. This
60 value must be in the range 0 to 9. The default is nine numeric
61 places.
62
63 -v Show the version number and the usage message of this release of
64 the gcalctool program.
65
66 -? Show the version number and the usage message of this release of
67 the gcalctool program. Note that the ? character must be
68 escaped if using csh(1).
69
71 On startup, gcalctool uses the following string type resources stored
72 in a gconf database:
73
74 Resource: /schemes/apps/gcalctool/accuracy
75 Values: Accuracy value
76 Description The number of of digits displayed after the numeric
77 point. This value must be in the range 0 to 9.
78
79 Resource: /schemes/apps/gcalctool/base
80 Values: Numeric Base
81 Description The initial numeric base. Valid values are "BIN"
82 (binary), "OCT" (octal), "DEC" (decimal) and "HEX"
83 (hexadecimal).
84
85 Resource: /schemes/apps/gcalctool/display
86 Values: Display mode
87 Description The initial display mode. Valid values are "ENG" (engi‐
88 neering), "FIX" (fixed-point) and "SCI" (scientific).
89
90 Resource: /schemes/apps/gcalctool/mode
91 Values: Mode
92 Description The initial calculator mode. Valid values are "BASIC",
93 "FINANCIAL" and "SCIENTIFIC".
94
95 Resource: /schemes/apps/gcalctool/showzeroes
96 Values: true, false (true)
97 Description Whether trailing zeroes, after the numeric point, are
98 shown in the display value.
99
100 Resource: /schemes/apps/gcalctool/showthousands
101 Values: true, false (false)
102 Description Whether fixed numbers in the decimal base are displayed
103 with thousands separated.
104
105 Resource: /schemes/apps/gcalctool/showregisters
106 Values: true, false (true)
107 Description Whether the memory register window is initially dis‐
108 played.
109
110 Resource: /schemes/apps/gcalctool/trigtype
111 Values: Trig. type
112 Description The initial trigonometric type. Valid values are "DEG"
113 (degrees), "GRAD" (grads) and "RAD" (radians).
114
116 This section describes the menu items available in the applications
117 menubar.
118
119 Calculator Menu
120 Quit [ Control-Q ]
121 Exit without user verification.
122 Edit Menu
123 Copy [ Control-C ]
124 Copy the calculators numeric display to the clip‐
125 board.
126 Paste [ Control-V ]
127 Paste the contents of the clipboard into the calcula‐
128 tors numeric display.
129 Insert ASCII Value [ Control-I ]
130 A separate window is displayed which allows you to
131 enter any character. The ASCII value of this charac‐
132 ter is then displayed in the current base.
133 View Menu
134 Basic Mode [ Control-B ]
135 Display the calculator in basic mode.
136 Financial Mode [ Control-F ]
137 Display the calculator in financial mode.
138 Scientific Mode [ Control-S ]
139 Display the calculator in scientific mode.
140 Memory Registers [ Control-M ]
141 Display the memory registers window.
142 Help Menu
143 Contents... [ F1 ]
144 Display the online help for the calculator in a sepa‐
145 rate window.
146 About Gcalctool [ Control-A ]
147 Display information about this application, including
148 the version number and the author.
150 This section describes the calculator keys present in the main
151 gcalctool window. gcalctool has three modes; basic, financial and sci‐
152 entific. The keys associated with each of these modes are described in
153 separate sections below.
154
155 Keyboard equivalents appear in the square brackets. Note that Alt fol‐
156 lowed by a letter indicates that the Alt key and this key should be
157 pressed together.
158
160 Numerical Keys [ 0-9 . = <Return> ].
161 Enter a digit (decimal digits 0-9) into the display. The '.' character
162 acts as the numeric point, and '=' (or Return) is used to complete
163 numerical entry.
164
165 Upto forty digits may be entered.
166
167 Arithmetical Operations [ + - x * / ].
168 Perform an arithmetical operation using the previous entry and the next
169 entry as operands. Addition, subtraction, multiplication and division
170 are denoted by the characters '+', '-', '*' and '/' respectively ('x'
171 is also synonymous with multiplication).
172
173 Number Manipulation Operators.
174 Int [ i ] Return the integer portion of the current entry.
175 Frac [ : ] Return the fractional portion of the current entry.
176 Abs [ u ] Return the absolute value of the current entry.
177 +/- [ c ] Change the arithmetic sign of the current entry.
178 1/x [ r ] Return the value of 1 divided by the current entry.
179 x^2 [ @ ] Return the square of the current entry.
180 % [ % ] Perform a percentage calculation using the last entry
181 and the next entry.
182 Sqrt [ s ] Perform a square root operation on the current entry.
183
184 Menu Operations.
185 Each of these operations has a popup menu associated with it. It is
186 also possible to use just the keyboard to achieve the same results.
187 The first keyboard value selects the menu operation; the second key‐
188 board character selects the new value for this operation. Unlike the
189 menu facility available with the mouse, there is no visual feedback on
190 what choices are available to you, so the user has to know what item
191 they wish to select.
192 Acc [ a ] Set the display accuracy. Between 0 and 9 [ 0-9 ]
193 significant digits can be displayed.
194 Rcl [ R ] Retrieve memory register value. There are ten memory
195 registers [ 0-9 ].
196 Sto [ S ] Store value in memory register. There are ten memory
197 registers [ 0-9 ]. The register number may be pre‐
198 ceded by an arithmetic operation (addition, subtrac‐
199 tion, multiplication or division), in which case the
200 specified operation is carried out between the dis‐
201 played entry and the value currently in the selected
202 memory register, and the result is placed in the mem‐
203 ory register.
204 Exch [ X ] Exchange the current display with the contents of a
205 memory register. There are ten memory registers [ 0-9
206 ].
207 Other Operations.
208 Clr [ Delete ] Clear the display, and reset the calculator.
209 CE [ Control-Back Space or Escape ]
210 Clear the display.
211 Bksp [ Back Space ]
212 Remove the rightmost character of the current entry,
213 and recalculate the displayed value.
214
216 An example of how to use each of these financial calculations, is
217 available via the tooltip help facility.
218 Ctrm [ m ] Compounding term. Computes the number of compounding
219 periods it will take an investment of present value
220 pv to grow to a future value of fv, earning a fixed
221 interest rate int per compounding period.
222 Memory register usage:
223 Register 0 int (periodic interest rate).
224 Register 1 fv (future value).
225 Register 2 pv (present value).
226
227 Ddb [ d ] Double-declining depreciation. Computes the deprecia‐
228 tion allowance on an asset for a specified period of
229 time, using the double-declining balance method.
230 Memory register usage:
231 Register 0 cost (amount paid for asset).
232 Register 1 salvage (value of asset at end of
233 life).
234 Register 2 life (useful life of the asset).
235 Register 3 period (time period for deprecia‐
236 tion allowance).
237
238 Fv [ v ] Future value. This calculation determines the future
239 value of an investment. It computes the future value
240 based on a series of equal payments, each of amount
241 pmt, earning periodic interest rate int, over the
242 number of payment periods in term.
243 Memory register usage:
244 Register 0 pmt (periodic payment).
245 Register 1 int (periodic interest rate).
246 Register 2 n (number of periods).
247
248 Pmt [ P ] Periodic payment. Computes the amount of the periodic
249 payment of a loan. Most installment loans are com‐
250 puted like ordinary annuities, in that payments are
251 made at the end of each payment period.
252 Memory register usage:
253 Register 0 prin (principal).
254 Register 1 int (periodic interest rate).
255 Register 2 n (term).
256
257 Pv [ p ] Present value. Determines the present value of an
258 investment. It computes the present value based on a
259 series of equal payments, each of amount pmt, dis‐
260 counted at periodic interest rate int, over the num‐
261 ber of periods in term.
262 Memory register usage:
263 Register 0 pmt (periodic payment).
264 Register 1 int (periodic interest rate).
265 Register 2 n (term).
266
267 Rate [ T ] Periodic interest rate. Returns the periodic interest
268 necessary for a present value of pv to grow to a
269 future value of fv over the number of compounding
270 periods in term.
271 Memory register usage:
272 Register 0 fv (future value).
273 Register 1 pv (present value).
274 Register 2 n (term).
275
276 Sln [ l ] Straight-line depreciation. Computes the straight-
277 line depreciation of an asset for one period. The
278 straight-line method of depreciation divides the
279 depreciable cost (cost - salvage) evenly over the
280 useful life of an asset. The useful life is the num‐
281 ber of periods (typically years) over which an asset
282 is depreciated.
283 Memory register usage:
284 Register 0 cost (cost of the asset).
285 Register 1 salvage (salvage value of the
286 asset).
287 Register 2 life (useful life of the asset).
288
289 Syd [ Y ] Sum-of-the-years-digits depreciation. The sum-of-the-
290 years'-digits method of depreciation accelerates the
291 rate of depreciation, so that more depreciation
292 expense occurs in earlier periods than in later ones.
293 The depreciable cost is the actual cost minus salvage
294 value. The useful life is the number of periods (typ‐
295 ically years) over which an asset is depreciated.
296 Memory register usage:
297 Register 0 cost (cost of the asset).
298 Register 1 salvage (salvage value of the
299 asset).
300 Register 2 life (useful life of the asset).
301 Register 3 period (period for which deprecia‐
302 tion is computed).
303
304 Term [ t ] Payment period. Returns the number of payment periods
305 in the term of an ordinary annuity necessary to accu‐
306 mulate a future value of fv, earning a periodic
307 interest rate of int. Each payment is equal to amount
308 pmt.
309 Memory register usage:
310 Register 0 pmt (periodic payment).
311 Register 1 fv (future value).
312 Register 2 int (periodic interest rate).
313
315 This section describes the functionality available in the calculators
316 scientific mode. This also includes a special mode panel used for set‐
317 ting various options.
318
319 Mode Panel.
320 Numeric Base Set the numeric base of operation. Choices are
321 binary, octal, decimal (the default) and hexadecimal.
322
323 Display Type Set the display mode. Valid values are "Eng" (engi‐
324 neering), "Fix" (fixed-point) and "Sci" (scientific).
325
326 Trigonometric Type
327 Set the trigonometric type. Valid values are Degrees,
328 Gradians and Radians.
329
330 Hyp Toggle the hyperbolic function indicator. This switch
331 affects the type of sine, cosine and tangent trigono‐
332 metric functions performed.
333
334 Inv Toggle the inverse function indicator. This switch
335 affects the type of sine, cosine and tangent trigono‐
336 metric functions performed.
337
338 Menu Operations.
339 Con [ # ] Retrieve and display a constant value. There are ten
340 constant values [ 0-9 ], and each one has a default
341 value which can be overridden when the user creates
342 their own constant definitions. The ten default val‐
343 ues are:
344
345 0 0.621 kilometers per hour or miles per
346 hour
347 1 1.414213562 square root of 2
348 2 2.718281828 e
349 3 3.141592653 pi
350 4 0.3937007 centimeters or inches
351 5 57.295779513 degrees in a radian
352 6 1048576.0 2 to the power of 20
353 7 0.0353 grams or ounces
354 8 0.948 kilojoules or British thermals
355 9 0.0610 cubic centimeters or cubic inches
356 Fun [ f ] Retrieve and execute a function expression. There can
357 be upto ten functions expression defined by the user
358 [0 - 9]. There are no default function values.
359
360 Scientific buttons.
361 < [ < ] Shift the current entry to the left. The shift can be
362 between 1 and 15 places [ 1-9, A-F ]. This calculator
363 key has a popup menu associated with it.
364 > [ > ] Shift the current entry to the right. The shift can
365 be between 1 and 15 places [ 1-9, A-F ]. This calcu‐
366 lator key has a popup menu associated with it.
367 &16 [ ] ] Truncate the current entry to a 16 bit unsigned inte‐
368 ger.
369 &32 [ [ ] Truncate the current entry to a 32 bit unsigned inte‐
370 ger.
371 ( and ) [ ( and ) ]
372 Parentheses. Allow precedence with arithmetic calcu‐
373 lations. Note that parentheses can be nested to any
374 level, and gcalctool provides a visual feedback of
375 what is being typed in, in the calculator display.
376 The calculation doesn't take place until the last
377 parenthesis is matched, then the display is updated
378 with the new result.
379 Exp [ e ] This is used to allow numbers to be entered in scien‐
380 tific notation. The mantissa should be initially
381 entered, then the Exp key selected. The exponent is
382 then entered. If no numerical input had occurred when
383 the Exp key was selected, then a mantissa of 1.0 is
384 assumed.
385 e^x [ { ] Returns e raised to the power of the current entry.
386 10^x [ } ] Returns 10 raised to the power of the current entry.
387 y^x [ y ] Take the last entry and raise it to the power of the
388 next entry.
389 x! [ ! ] Return the factorial of the current entry. Note that
390 the factorial function is only valid for positive
391 integers.
392 Rand [ ? ] Return a random number between 0.0 and 1.0.
393 Hexadecimal Keys [ A-F ]
394 The hexadecimal numerical digits A-F. These buttons
395 will be insensitive unless the calculator is cur‐
396 rently in the hexadecimal mode.
397 Cos [ J ] Return the trigonometric cosine, arc cosine, hyper‐
398 bolic cosine or inverse hyperbolic cosine of the cur‐
399 rent display, depending upon the current settings of
400 the hyperbolic and inverse function switches. The
401 result is displayed in the current trigonometric
402 units (degrees, radians or grads).
403 Sin [ K ] Return the trigonometric sine, arc sine, hyperbolic
404 sine or inverse hyperbolic sine of the current dis‐
405 play, depending upon the current settings of the
406 hyperbolic and inverse function switches. The result
407 is displayed in the current trigonometric units
408 (degrees, radians or grads).
409 Tan [ L ] Return the trigonometric tangent, arc tangent, hyper‐
410 bolic tangent or inverse hyperbolic tangent of the
411 current display, depending upon the current settings
412 of the hyperbolic and inverse function switches. The
413 result is displayed in the current trigonometric
414 units (degrees, radians or grads).
415 Ln [ N ] Return the natural logarithm of the current entry.
416 Log [ G ] Return the base 10 logarithm of the current entry.
417 Or [ | ] Perform a logical OR operation on the current entry
418 and the next entry,
419 And [ & ] Perform a logical AND operation on the current entry
420 and the next entry, treating both numbers as unsigned
421 long integers.
422 Not [ ~ ] Perform a logical NOT operation on the current entry.
423 Xor [ ^ ] Perform a logical XOR operation on the current entry
424 and the next entry, treating both numbers as unsigned
425 long integers.
426 Xnor [ n ] Perform a logical XNOR operation on the current entry
427 and the next entry, treating both numbers as unsigned
428 long integers.
429
431 ~/.gcalctoolrc user's personal gcalctool resources for customizing
432 the appearance and color of gcalctool
433
434 8 January 2007 gcalctool(1)