.TH CALCULATOR 1 "30 January 2002"
.SH NAME
calculator \- simple desktop calculator
.SH SYNOPSIS
\fBcalculator\fP
.SH DESCRIPTION
.LP
The FOX Calculator is a simple desktop calculator geared toward the
programmer.
It supports not only a full complement scientific functions, but also common
operations that programmers need, such as bitwise operations, bitwise
shifting, and base-2 logarithm and exponents, and numeric conversion between
hexadecimal, octal, binary, and decimal.
The FOX Calculator implements correct operator precedences, so expressions
like 2+3*5 yield the correct result, which is 17, and not 25.
Also featured is a constant memory, which permanently stores its value even if
you exit the calculator and restart it later.
.SH CONFIGURATION
Pressing on the calculator icon brings up the Calculator Preferences dialog.
The Calculator Preferences dialog comprises three settings:
- Settings for the calculator itself;
.br
- Color settings of the button groups;
.br
- Information about the calculator.
In the Calculator settings panel, you can change font used for the
display, by pressing the "Set..." button to bring up the standard Font
Selection Dialog.
You can change the way numbers are printed as well. Checking "Always show exponent"
will cause the calculator display always to display the number in exponential notation.
Checking "Never show exponent" will cause the calculator to render the number in simple
dot notation.
The precision can be set by means of the spin button; the default precision is set to 16.
Finally, the calculator can be set to beep when errors occur.
In the Color settings panel, you can change the colors of the various button groups.
The buttons are grouped by function; the numbers are in one group, and the operators are
in another, and so on.
In the About panel, some information is presented about the calculator, like version
number and author's contact.
.SH ENTERING NUMBERS
You can enter a number by clicking on the digit buttons, or simply hit the right
digit on the keyboard. Numbers in exponential notation are entered by entering the
mantissa first, then hitting the "EXP" button, and then entering the exponent.
Up to 3 digits may be entered for the exponent; entering more than 3 will cause the
digits to shift, i.e. the first digit entered will be dropped and replaced by the
second, the second digit will be replaced by the third, and the third will be replaced
by the new input.
Changing the sign of the exponent is accomplished by hittin the \"+/-\" button.
At any time, you can hit the Backspace key to delete the last digit entered.
Two numbers, pi and e (euler's number) may be entered with a single button:
.TP
pi - Enters the number 3.1415926535897932384626433833
.TP
e - Enters the number 2.7182818284590452353602874713 (hit the "inv" button first)
.SH OPERATORS
The operators in the FOX Calculator are the usual suspects:
.TP
.I +
Addition
.TP
.I \-
Substraction
.TP
.I *
Multiplication
.TP
.I /
Floating point division
.P
In addition, FOX Calculator also includes bitwise operators, such as:
.TP
.I AND
Bit-wise logical and
.TP
.I OR
Bit-wise logical or
.TP
.I XOR
Bit-wise logical exclusive or
.TP
.I NOT
Bit-wise logical not
.TP
.I SHL
Bit-wise shift left
.TP
.I SHR
Bit-wise shift right
.TP
.I SAR
Bit-wise signed shift right (hit the "inv" button first)
.P
Also nice for programmers is the inclusion of integer operations:
.TP
.I mod
Integer modulo
.TP
.I div
Integer division (hit the \"inv\" button first)
.P
All the operators have certain precedence relations with each other, so that
an expression is evaluated correctly.
.SH TRIGONOMETRIC FUNCTIONS
The Calculator incorporates the usual trigonometric functions:
.TP
.I sin
Sine
.TP
.I cos
Cosine
.TP
.I tan
Tangent
.TP
.I asin
Inverse sine or arc sine (hit the "inv" button first)
.TP
.I acos
Inverse cosine
.TP
.I atan
Inverse tangent
.TP
.I sinh
Hyperbolic sine (hit the "hyp" button first)
.TP
.I cosh
Hyperbolic cosine
.TP
.I tanh
Hyperbolic tangent
.TP
.I asinh
Inverse hyperbolic sine (hit the "hyp" and "inv"buttons first)
.TP
.I acosh
Inverse hyperbolic cosine
.TP
.I atanh
Inverse hyperbolic tangent
.P
For the first 6 functions, the angle mode determines whether the argument is
specified in terms of degrees, radians, or grad.
Note that the angle mode is preserved across invocations of the Calculator.
.SH OTHER FUNCTIONS
Other functions supported by the calculator are the following:
.TP
.I log
Base 10 logarithm
.TP
.I ln
Natural logarithm
.TP
.I 2log
Base 2 logarithm
.TP
.I x!
Factorial
.TP
.I nPr
Permutations
.TP
.I nCr
Combinations
.TP
.I sqrt
Square root
.TP
.I x^y
X raised to the power y
.TP
.I 1/x
Reciprocal
.TP
.I 10^x
Base 10 exponentiation (hit the "inv" button first)
.TP
.I e^x
Exponentiation
.TP
.I 2^x
Base 2 exponentiation
.TP
.I x^1/y
X raised to the power 1/y
.TP
.I x^2
X squared
.SH LIMITS
The calculator works in IEEE 746 double precision mode; for bit-wise operations,
it uses 32 bit integers. Thus, the numeric limits are as follows:
.P
Smallest real number: 2.2250738585072010e-308
.br
Largest real number: 1.7976931348623158e+308
.br
Smallest integer number: 0
.br
Largest integer number: 4294967295
.SH AUTHOR
This manpage was originally written by Bastian Kleineidam
for the Debian distribution of the FOX Toolkit.
The main author of FOX is Jeroen van der Zijp . For a list of
contributors see /usr/share/doc/libfox0.99/AUTHORS.