[CALC] Improve multi-precision support, and powers/roots. CORE-8486
[reactos.git] / base / applications / calc / help.txt
1 ReactOS Calc is a programme for evaluating mathematical, financial and statistical calculations.
2
3 ReactOS Calc has several features including:
4 - Internal precision with 17 decimal numbers (standard IEEE math library).
5 - Up to 512 bits of internal precision and 64 decimal digits displayed in the output display (with GNU multi-precision libraries).
6 - Robust RPN (reverse polish notation) engine which allows a virtually unlimited number of arithmetic and algebraic sub-expressions.
7 - Three different interfaces: standard, scientific or conversion.
8 - Many common arithmetic, algebraic and statistical functions are included.
9
10 The following topics will be discussed:
11
12 HOW TO INPUT NUMBERS
13 DISPLAY FORMAT
14 ERROR MESSAGE
15 ARITHMETIC FUNCTIONS
16 LOGICAL FUNCTIONS
17 ALGEBRAIC FUNCTIONS
18 TRIGONOMETRIC FUNCTIONS
19 THE PI BUTTON
20 HYPERBOLIC FUNCTIONS
21 STATISTICAL FUNCTIONS
22 MEMORY FUNCTION
23 DEGREE CONVERSION
24 FIXED SCIENTIFIC NOTATION
25 PERCENT MODE
26
27 HOW TO INPUT NUMBERS
28 --------------------
29 The ReactOS Calc provides some buttons for typing numbers and expressions.
30 However, some of them are available only into Standard, Conversion or Scientific modes, or when the calculator is in a specific state.
31 [0], [1], [2], [3], [4], [5], [6], [7], [8], [9]
32 Digit buttons: they are used for entering digits into the display.
33 [A], [B], [C], [D], [E], [F]
34 Hexadecimal buttons: they are used for completing an hex number. For using these buttons, the calculator must be configured into scientific mode and the [HEX] state must be selected.
35 [.] or [,]
36 Decimal point: used for starting the non integer part of a decimal number.
37 [+/-]
38 Change sign: if it's pressed after a calculation or when entering the operands, it will change the sign of the number shown into the output display.
39 [BACK]
40 If the displayed number has been entered manually and it isn't a result of a calculation, you can delete the last digit by pressing this button.
41 [CE]
42 This button removes an incorrect number from the output display. All pending operations are preserved.
43 [ C ]
44 It clears the output display and all pending operations.
45
46 DISPLAY FORMAT
47 --------------
48 You can enter digits by pressing the buttons mentioned in the <HOW TO INPUT NUMBERS> section.
49 These numbers can be entered into four different bases: hexadecimal, decimal, octal or binary system.
50 A number shown into the output display can be easily converted from a numeric base to another by simply changing the base on the fly.
51
52 When working with pure decimal numbers, the user can enter the numbers in two ways:
53 - Normal mode: each number is entered its integer part and, eventually, its fractional part.
54 - Exponential mode: the number is entered by typing a mantissa and then an exponent. This method allows you to write very big or very small numbers that you would not be able to type in a different manner. You can use it only when the calculator is configured in scientific mode.
55 However, there are some limits even when you work with exponential notation.
56 These limits are:
57 -1.79769313486231570e+308 <= x <= -2.22507385850720140e-308
58 2.22507385850720140e-308 <= x <= 1.79769313486231570e+308
59 The exponential input mode is activated by the [Exp] button.
60 After the mantissa has been typed, by pressing this button you will be able to enter the exponent.
61 When the support for GNU multi-precision libraries is activated, these limits rise greatly to 64 displayed digits for the mantissa and 8 digits for the exponent, both with sign.
62
63 When the calculator is in [HEX], [OCT] or [BIN] state, it's possible to apply a masking for limiting the range of the numbers. Four range are available:
64 [QWORD]
65 It limits the integers to 64 bit numbers.
66 [DWORD]
67 It limits the integers to 32 bit numbers.
68 [WORD]
69 It limits the integers to 16 bit numbers.
70 [BYTE]
71 It limits the integers to 8 bit numbers.
72
73 ERROR MESSAGE
74 -------------
75 The output display will show the message "Error" if the current calculation overflows the limits of the calculator, or when an undefined condition is generated (example: division by zero).
76 The error condition is cleared using the [ C ] button.
77
78 ARITHMETIC FUNCTIONS
79 --------------------
80 ReactOS Calc implements the standard arithmetic rules with the following operators:
81 [+]
82 Addition
83 [-]
84 Subtraction
85 [*]
86 Multiplication
87 [/]
88 Division
89 [Mod]
90 Remainder of a division
91 Those rules express the concept of priority.
92 Here there is a list of priorities implemented from the highest to the lowest:
93 - Special functions which change directly the current value into a new one: trigonometrics, hyperbolics, exponentials and logarithms, reciprocal, base conversions, integer and fractional part detection and change of sign.
94 - Power and root functions.
95 - multiplications, divisions, reminders.
96 - additions, subtractions.
97 - Logical functions.
98 These rules may be overcome by using parentheses.
99 With [(] and [)] buttons, the user can isolate a mathematical expression to be evaluated separately. The number of parentheses into a single expression is virtually unlimited. The number of currently-open parentheses is displayed in the left box underneath the base change option set.
100
101 LOGICAL FUNCTIONS
102 -----------------
103 There is a set of logical functions which can be used between two operands. They can be used as normal arithmetic operators.
104 The only exception is the "Not" operator which works on a single number.
105 The provided functions are:
106 [And]
107 It executes an "and" between the numbers.
108 [Or]
109 It executes an "or" between the numbers.
110 [Xor]
111 It executes an "exclusive or" between the numbers.
112 [Not]
113 It inverts all bits of the number shown into the output display.
114
115 ALGEBRAIC FUNCTIONS
116 -------------------
117 ReactOS Calc implements the most commonly used algebraic functions.
118 [Int]
119 It isolates the integer part of the number shown into the output display.
120 [Inv]+[Int]
121 The integer part of the number is discarded and the fractional part stays on the output display.
122 [x^2]
123 Square function. It calculates the square of the number shown on the output display.
124 [Inv]+[x^2]
125 It returns the positive square root of the number shown on the output display.
126 If the current number is negative, then the error message will be displayed.
127 When working with standard and conversion layouts, the [sqrt] button is a shortcut to this function.
128 [x^3]
129 Cube function. It calculates the cube of the number shown on the output display.
130 [Inv]+[x^3]
131 It returns the cube root of the number shown on the output display.
132 [x^y]
133 Power function. It calculates the power of X elevated to Y.
134 [Inv]+[x^y]
135 Root function. It calculates the Y-th root of X.
136 [1/x]
137 Reciprocal. It divides 1 by the number shown on the output display.
138 [n!]
139 Factorial. It calculates the factorial of the integer part of the number shown into the output display.
140 The calculation is defined within these limits:
141 0 <= n <= 170
142 [ln]
143 Natural logarithm. It calculates the natural logarithm of the current number.
144 ReactOS Calc assumes the Nepero's constant to be:
145 e=2.7182818284590452354
146 The calculation is defined for x > 0.
147 [Inv]+[ln]
148 Natural anti-logarithm. It calculates the power of the Nepero's constant to the current number.
149 [Log]
150 Decimal logarithm. It calculates the logarithm of the current number to base 10.
151 The calculation is defined for x > 0.
152 [Inv]+[Log]
153 Decimal anti-logarithm. It calculates the power of 10 to the current number.
154
155 TRIGONOMETRIC FUNCTIONS
156 -----------------------
157 ReactOS Calc allows the calculation of three types of trigonometric functions with their inverse operations.
158 These functions can be used with three different angular units of measurement: degrees, radians or gradians.
159 The angular mode does not affect the non trigonometric functions.
160 Please note that the degree type uses decimal degrees and not angles in the degree-minute-second form.
161 The available functions are:
162 [sin]
163 It calculates the sine of the given angle.
164 If the [Inv] modifier is activated, it finds the angle whose sine value is shown into the output display.
165 [cos]
166 It calculates the cosine of the given angle.
167 If the [Inv] modifier is activated, it finds the angle whose cosine value is shown into the output display.
168 [tan]
169 It calculates the tangent of the given angle.
170 If the [Inv] modifier is activated, it finds the angle whose tangent value is shown into the output display.
171
172 THE PI BUTTON
173 -------------
174 For helping the calculations with trigonometric functions, it's possible to load the value of 'Pi' into the output display.
175 The function is called by pressing the [PI] button.
176 If the [Inv] modifier is activated, then the output display will be loaded with 2*PI.
177 In ReactOS Calc, Pi has the value 3.14159265358979323846
178
179 HYPERBOLIC FUNCTIONS
180 --------------------
181 ReactOS Calc allows the calculation of three types of hyperbolic functions with their inverse operations.
182 Those functions are activated by the same buttons used for trigonometric functions; the hyperbolic context is enabled by activating the [Hyp] modifier. The inverse functions are activated by the [Inv] modifier.
183 [sin]+[Hyp]
184 Hyperbolic sine
185 [cos]+[Hyp]
186 Hyperbolic cosine
187 [tan]+[Hyp]
188 Hyperbolic tangent
189
190 STATISTICAL FUNCTIONS
191 ---------------------
192 By pressing the [STA] button, the statistical window is enabled.
193 Statistical window allows to store groups of number and execute some common statistical operators.
194 Into the statistical box, there are four buttons with these functions:
195 [RET]
196 It moves the focus back to the calculator.
197 [LOAD]
198 It loads the selected number into the output display of the calculator.
199 [CD]
200 It deletes the selected number from the list.
201 [CAD]
202 It deletes all numbers currently stored into the list.
203
204 While the statistical window is shown, four additional buttons are enabled:
205 [Ave]
206 It calculates the arithmetic average of the numbers stored into the list.
207 [Ave] + [Inv]
208 It calculates the arithmetic average of the squares of the numbers stored into the list.
209 [Sum]
210 It calculates the sum of all numbers stored into the list.
211 [Sum] + [Inv]
212 It calculates the sum of the squares of all numbers stored into the list.
213 [s]
214 It calculates the population standard deviations with base 'n-1' of the numbers stored into the list.
215 [s] + [Inv]
216 It calculates the population standard deviations with base 'n' of the numbers stored into the list.
217 [Dat]
218 It inserts the number shown into the output display into the list.
219
220 Note: when the statistical box is closed, its content is lost.
221
222 MEMORY FUNCTION
223 ---------------
224 ReactOS Calc reserves for the user a memory region for storing data.
225 With this feature, the user can store frequently used numbers (typically, these numbers are constants) and recall them at any time, without the need to re-enter them manually.
226 If the memory function is currently in use, the text "M" will appear in the right box underneath the base change option set.
227 The memory is preserved when switching between standard, conversion and scientific modes, but its content is lost when ReactOS Calc application is closed.
228 Four keys are available with memory function support.
229 [MC]
230 Memory Clear: clears the content of the memory.
231 [MR]
232 Memory Recall: retrieves the stored data from the memory and it shows it into the output display, without affecting the content of the storage.
233 [MS]
234 Memory Store: stores the displayed value into the memory. The content of the display is unaffected. After pressing this button, the previous content of the memory is lost. If the [INV] modifier is activated, then this button will swap current memory value with displayed value. Under these conditions, the displayed value is stored and the previously stored quantity is shown on the output display.
235 If the memory is empty, it will act as a normal store.
236 [M+]
237 Memory Sum: the displayed value is algebraically added to the current memory. The output display will be unchanged after this transfer and addition. If the [INV] modifier is activated, then the displayed value will be algebraically subtracted from the memory. If the memory is empty, it will work in both condition as a simple memory store.
238
239 DEGREE CONVERSION
240 -----------------
241 With [dms] button you can convert decimal degrees into degree-minute-second format and vice-versa.
242 When working with d-m-s angles, the notation used into the output display is "DDD.MMSS" where D stands for degree, M for minute and S for second.
243 The [dms] button will convert decimal angles to degree-minute-second angles.
244 The [dms] button with [Inv] modifier will convert degree-minute-second angles into decimal angles.
245
246 FIXED SCIENTIFIC NOTATION
247 -------------------------
248 When working with ReactOS Calc, it is possible to select a temporary scientific notation (activated by [Exp] button) or a fixed scientific notation.
249 Fixed scientific notation will be turned on by pressing [F-E] button.
250 When fixed scientific notation is active, all results will be displayed with scientific notation even for small numbers.
251 The calculator will be restored to normal mode by pressing [F-E] button again or by pressing the [ C ] button.
252
253 PERCENT
254 -------
255 The [%] button is available only with standard and conversion layouts and it's used as modifier for the four basic arithmetic operators.
256 The input sequence for a percent calculation is:
257 "first" "operator" "second" "percent"
258 The modification applied by the percent button for each operator are:
259 [+]
260 Add "second"-% of "first" to "first".
261 [-]
262 Subtract "second"-% of "first" from "first".
263 [*]
264 Multiply "second"-% of "first" with "first".
265 [/]
266 Divide "first" by "second"-% of "first".
267
268 GLOSSARY
269 --------
270
271 Output display
272 This is the place where the typed numbers and the results of the calculations are shown.
273
274 Hex
275 It selects the hexadecimal numeric base and it converts the number shown into the output display.
276 Shortcut from keyboard: F5
277
278 Dec
279 It selects the decimal numeric base and it converts the number shown into the output display.
280 Shortcut from keyboard: F6
281
282 Oct
283 It selects the octal numeric base and it converts the number shown into the output display.
284 Shortcut from keyboard: F7
285
286 Bin
287 It selects the binary numeric base and it converts the number shown into the output display.
288 Shortcut from keyboard: F8
289
290 Degrees
291 It enables the processing of trigonometric functions into degree format.
292 Shortcut from keyboard: F2
293
294 Radians
295 It enables the processing of trigonometric functions into radians format.
296 Shortcut from keyboard: F3
297
298 Gradians
299 It enables the processing of trigonometric functions into gradians format.
300 Shortcut from keyboard: F4
301
302 Qword
303 It limits the length of integer numbers to 64 bits.
304 Shortcut from keyboard: F12
305
306 Dword
307 It limits the length of integer numbers to 32 bits.
308 Shortcut from keyboard: F2
309
310 Word
311 It limits the length of integer numbers to 16 bits.
312 Shortcut from keyboard: F3
313
314 Byte
315 It limits the length of integer numbers to 8 bits.
316 Shortcut from keyboard: F4
317
318 Inv
319 It enables the inverse function for [sin] [cos] [tan] [pi] [x^y] [x^2] [x^3] [ln] [log] [dms] [MS] [M+] [Int] buttons.
320 Shortcut from keyboard: I
321
322 Hyp
323 It enables the hyperbolic mode for [sin] [cos] [tan] buttons
324 Shortcut from keyboard: H
325
326 Back
327 It deletes the last digit typed on the calculator.
328 It also disables the temporary scientific mode if an exponent is removed completely.
329 Shortcut from keyboard: Backspace
330
331 CE
332 It deletes the last typed number from the output display.
333 Shortcut from keyboard: Delete
334
335 _C_
336 It deletes the current calculation and all sub expressions.
337 Shortcut from keyboard: ESC
338
339 F-E
340 It enables or it disables the fixed scientific notation.
341 Shortcut from keyboard: V
342
343 0 1 2 3 4 5 6 7 8 9
344 These buttons are used for entering digits.
345 Shortcut from keyboard: the corresponding number on the keyboard or the numeric pad.
346
347 A B C D E F
348 These buttons are used for entering hexadecimal numbers.
349 Shortcut from keyboard: the letters from A to F.
350
351 +/-
352 It changes the sign of the number.
353 Shortcut from keyboard: F9
354
355 . or ,
356 It adds the decimal point for a decimal number.
357 Shortcut from keyboard: , or .
358
359 +
360 Addition
361 Shortcut from keyboard: +
362
363 -
364 Subtraction
365 Shortcut from keyboard: -
366
367 *
368 Multiplication
369 Shortcut from keyboard: *
370
371 /
372 Division
373 Shortcut from keyboard: /
374
375 =
376 It resolves the current calculation and all sub expressions.
377 Shortcut from keyboard: =
378
379 Mod
380 Remainder of an integer division.
381 Shortcut from keyboard: %
382
383 And
384 Logical "and".
385 Shortcut from keyboard: &
386
387 Or
388 Logical "or".
389 Shortcut from keyboard: |
390
391 Xor
392 Logical exclusive "or".
393 Shortcut from keyboard: ^
394
395 Lsh
396 Logical shift to left.
397 Shortcut from keyboard: <
398
399 Not
400 Logical bit inversion.
401 Shortcut from keyboard: ~
402
403 Int
404 It isolates the Integer or fractional part of a number.
405 Shortcut from keyboard: ;
406
407 MC
408 It deletes the memory.
409 Shortcut from keyboard: CTRL-L
410
411 MR
412 It recalls a previously stored number from the memory.
413 Shortcut from keyboard: CTRL-R
414
415 MS
416 It stores a number into the memory and it eventually transfers the previous value to the output display.
417 Shortcut from keyboard: CTRL-M
418
419 M+
420 It adds or it subtracts the value into the output display to the memory.
421 Shortcut from keyboard: CTRL-P
422
423 pi
424 It loads the pi or 2*pi value into the output display.
425 Shortcut from keyboard: P
426
427 (
428 It starts a new sub expression.
429 Shortcut from keyboard: (
430
431 )
432 It closes and it resolves a sub expression.
433 Shortcut from keyboard: )
434
435 dms
436 It converts a decimal degree to a decimal-minute-second degree and viceversa.
437 Shortcut from keyboard: M
438
439 Exp
440 It enables the temporary scientific notation.
441 Shortcut from keyboard: X
442
443 ln
444 It calculates the natural logarithm. Natural anti logarithm calculation is activated by Inv modifier.
445 Shortcut from keyboard: N
446
447 Log
448 It calculates the decimal logarithm. Decimal anti logarithm calculation is activated by Inv modifier.
449 Shortcut from keyboard: L
450
451 n!
452 It calculates the factorial of a number.
453 Shortcut from keyboard: !
454
455 1/x
456 It calculates the reciprocal of a number.
457 Shortcut from keyboard: R
458
459 sin
460 It calculates the sine, hyperbolic sine, arcsine or the hyperbolic arcsine of an angle.
461 Shortcut from keyboard: S
462
463 cos
464 It calculates the cosine, hyperbolic cosine, arcsine or the hyperbolic arccosine of an angle.
465 Shortcut from keyboard: O
466
467 tan
468 It calculates the tangent, hyperbolic tangent, arcstangent or the hyperbolic arctangent of an angle.
469 Shortcut from keyboard: T
470
471 x^y
472 It calculates the power of X to Y.
473 With the Inv modifier, it calculates the Yth root of X.
474 Shortcut from keyboard: Y
475
476 x^2
477 It calculates the square of X.
478 With the Inv modifier, it calculates the square root of X.
479 Shortcut from keyboard: @
480
481 x^3
482 It calculates the cube of X.
483 With the Inv modifier, it calculates the cubic root of X.
484 Shortcut from keyboard: $
485
486 Sta
487 It enables the statistical window and its functions.
488 Shortcut from keyboard: CTRL-S
489
490 Ave
491 It calculates the arithmetic average of the numbers stored into the statistical box.
492 When used with [Inv] modifier it calculates the average of squares.
493 Shortcut from keyboard: CTRL-A
494
495 Sum
496 It calculates the sum of the numbers stored into the statistical box.
497 When used with [Inv] modifier it calculates the summation of squares.
498 Shortcut from keyboard: CTRL-T
499
500 s
501 It calculates the standard deviation of the numbers stores into the statistical box.
502 Shortcut from keyboard: CTRL-D
503
504 Dat
505 It inserts a new number into the statistical box
506 Shortcut from keyboard: Insert
507
508 %
509 It executes the calculation with percent mode.
510 Shortcut from keyboard: %
511
512 sqrt
513 It calculates the square root of a number.
514 Shortcut from keyboard: @