# &app; Manual V&manrevision;

2004
Niklas Knutsson
Niklas Knutsson
Niklas
Knutsson
This manual describes version &appversion; of &app;.

## Feedback

To report a bug or make a suggestion regarding the &app; application or this manual go to the bug submission form or the &app; forums.

## Introduction

Qalculate! is not your regular software replication of the cheapest available calculator. Qalculate! aims to make full use of the superior interface, power and flexibility of modern computers.

The center of attention in Qalculate! is the expression entry, Instead of entering each number in a mathematical expression separately, you can directly write the whole expression and later modify it. Just enter an expression as you would write it on paper, press Enter and voila!

The interpretation of expressions is flexible and fault tolerant, and if you nevertheless do something wrong, Qalculate! will tell you so. Not fully solvable expressions are however not errors. Qalculate! will simplify as far as it can and answer with an expression.

In addition to numbers and arithmetic operators, an expression may contain any combination of variables, units, and functions. These are immediately accessible from the user interface — the menu bar, the managers, the calculator keypad, and automatic completion.

Qalculate! also has some special tools to increase your efficiency, including a number base conversion dialog and a simple plotting interface.

Although use of Qalculate! for simple calculations should be natural and self-explanatory, reading the rest of the manual can help you maximize your productivity and discover some maybe unexpected features. More advanced users should read on and discover a large number of customization options and the ability to create and modify your own variables, functions and units directly from the user interface.

## User Interface

### Main Window

#### Main Window

The main window provides a menu bar, the expression entry, the result display and a calculator keypad which can be shown/hidden by clicking on Keypad. There are two small buttons to right of the expression entry and the result display. The upper button performs calculation of the entered expression (same as Enter), while the one below opens a window showing previous calculations.

### Expression Entry

The expression entry is the most important part of the Qalculate! user interface. The normal calculation procedure in Qalculate! is to type in a mathematical expression (ex. 5+5) and press Enter (or click Execute). The result (10) is then displayed below the expression entry in the result display.

#### Completion

Qalculate! helps out with the expression by giving a list of possible endings to words representing functions, variables and units. The list will narrow with each letter typed. Select an item in the list and the name will be completed. If a function was selected, parenthesis will be added and the position moved for immediate entry of arguments.

After execution of an expression, the whole expression will be marked. This normally means that if something new is entered, the old expression will be overwritten. If, however, an operator (+, −, *, /, ^) is entered first, the old expression will instead be the target of action. The operator will then apply to the whole expression, which is put in parenthesis. This works on all marked ranges, meaning that this way an expression can conveniently be put in parenthesis. Functions set the selection as their first argument.

The Page Up and Page Down keys will access previously entered expressions. With focus in the expression entry, Page Up traverses backwards in the expression history and Page Down forward.

The font used for the expression entry can be selected in the preferences dialog (Edit Preferences).

### Result Display

The result of calculations is displayed in the open area below the expression entry. The font used for the result display can be selected in the preferences dialog (Edit Preferences). Use of Unicode signs can be turned off in the same dialog, in case of problems with missing characters. Otherwise Qalculate! will try to make the result as fancy as possible and print π for pi, √ for sqrt, € for euro, and so on. Information about customization of the mathematical result output is available in .

In front of the result an equals or approximately equals sign is shown. This indicates whether Qalculate! was able to calculate/display the result exact or only approximate, in the current mode.

The result display has a context menu, which pops up when clicking with the right mouse button anywhere in the field. This menu provides a subset of the display alternatives from the mode menu () and some actions from the edit menu (). See more info in .

To copy the result, either select Edit Copy Result, press Ctrl Alt C, or copy the text from the history window.

### Keypad

The keypad provides access to a fairly small set of traditional calculator buttons, which work as expected. The Convert button in the top left corner opens the convert to unit dialog (see ), while the buttons to the right open the functions, variables and units managers (see ).

#### Keypad

### Calculation History

The history window, opened with the button next to the result display, provides access to previous calculation results (20 rows are reloaded on restart). Previous expressions and results, as well as errors and warnings, are displayed in plain text and can be marked and copied (from the right-button context menu or with Ctrl C) to the expression entry or elsewhere.

#### Calculation History

### Menu Bar

The menus in the menu bar provides access to most of the functionality of Qalculate!. Their contents are listed and described below.

#### File Menu

Menu Item | Description
--- | ---
New | Submenu for creation of new objects. See .
Import CSV File... | Opens a dialog for import of a data file as a matrix or vectors.
Export CSV File... | Opens a dialog for export of a matrix or vector to a data file.
Store Result... (Ctrl S) | Stores the current result as a variable. See .
Save Definitions | Saves all user definitions (variables, functions and units).
Update Exchange Rates | Downloads current exchange rates from the Internet.
Plot Functions/Data | Opens the plot dialog. See .
Convert Number Bases (Ctrl B) | Opens the number bases converter. See
Periodic Table | Shows a periodic table, with property values which can be inserted in the expression, in a new window.
Quit (Ctrl Q) | Exits Qalculate!

#### New Menu

Menu Item | Description
--- | ---
Variable | Opens the variable edit dialog for creation of a new variable.
Matrix | Opens a dialog for entry of a new matrix variable.
Vector | Opens a dialog for entry of a new vector variable.
Unknown Variable | Opens the variable edit dialog for creation of a new unknown variable.
Function | Opens the function edit dialog for creation of a new function.
Unit | Opens the unit edit dialog for creation of a new unit.

#### Edit Menu

Menu Item | Description
--- | ---
Manage Variables (Ctrl M) | Opens the variable manager. See .
Manage Functions (Ctrl F) | Opens the function manager. See .
Manage Units (Ctrl U) | Opens the unit manager. See .
Factorize | Factorizes the current result. At the moment rather limited.
Convert To Unit | Submenu with units. Select a unit to convert the current result.
Set Prefix | Submenu for choice of unit prefix in current result.
Convert To Unit Expression (Ctrl T) | Opens the convert to unit dialog for conversion of result to custom unit expression. See .
Convert To Base Units | Splits up unit(s) in the current result into base units.
Convert To Best Unit | Tries to convert the units in the current result so that as few units as possible is used. Base units are prioritized.
Copy Result (Ctrl Alt C) | Copies the current result to the clipboard.
Preferences | Opens the preferences dialog, which controls settings for visual appearance and start/exit actions.

#### Mode Menu

Menu Item | Description
--- | ---
Number Base | Submenu which switches between binary, octal, decimal, hexadecimal, sexagesimal (normal or time format), and other bases, and roman numerals in result and expression.
Numerical Display | Submenu which selects numerical display mode. See .
Fractional Display | Submenu which selects decimal, fractional or combined fractional display. See .
Unit Display | Submenu which controls the display of units and prefixes. See .
Angle Unit | Submenu which sets the default angle unit for trigonometric functions.
Abbreviate Names | Toggles on/off use of abbreviation for unit, prefix, variable and function names in result display.
Enabled Objects | Submenu which enables/disables variables, functions, units and unknowns (will not affect defined unknown variables and quoted unknowns), and calculation of variables (If calculation of variables is not on, all variables will be treated as unknown). Here you can also disable complex and infinite results.
Approximation | Submenu which switches between different approximation modes.
Assumptions | Submenu which changes default assumptions for unknown variables.
Read Precision | Enables/disables interpretation of input numbers with decimals as approximate with a precision equal to the number of digits (after preceding zeroes).
RPN Mode | Toggles use of Reverse Polish Notation syntax in expressions on/off.
Precision | Opens a dialog to change precision in calculations.
Decimals | Opens a dialog to change displayed number of decimals.
Save Mode | Saves the current calculator mode.

#### Functions Menu

Menu Item | Description
--- | ---
(Recent functions list) | Select a function to open the insert function dialog.
(Function list) | Select a function to open the insert function dialog.

#### Variables Menu

Menu Item | Description
--- | ---
(Recent variables list) | Select a variable to insert it into the expression entry.
(Variable list) | Select a variable to insert it into the expression entry.

#### Units Menu

Menu Item | Description
--- | ---
(Recent units list) | Select a unit to insert it into the expression entry.
(Unit list) | Select a unit to insert it into the expression entry.

#### Help Menu

Menu Item | Description
--- | ---
Contents (F1) | Opens this help.
About | Info about Qalculate!

### Variable/Function/Unit Managers

The manager windows provide a structural way of working with variables, functions and units (collectively referred to as objects). The managers for the three different objects are essentially similar. They can be opened from the edit menu and the keypad. Ctrl M, Ctrl F and Ctrl U can also be used for variables, functions and units respectively.

#### Variable Manager

To the left is a category tree and beside that is a list of all objects in the selected category, including all subcategories. Objects without a category are put under Uncategorized. The top category, All, provides a list of all objects, except those that are deactivated and available in the second top-level category — Inactive. The object list does, in addition to descriptive names, for variables have an extra column for values of variables, and units have additional columns for abbreviation/singular/plural and base unit.

The buttons on the right work on the selected object in the list. New opens a dialog for creation of a new object, while Edit opens the same dialog to edit the selected unit. Insert inserts the object into the expression entry in the main window, Delete removes the object and (De)activate toggles recognition in expressions on/off. The unit manager has an additional button for conversion of the current result and the variable manager a button for export to a data file.

#### Function Manager

The function manager has a description box at the bottom, which shows the syntax, description and arguments of the selected function.

#### Unit Manager

The unit manager has an area for quick conversion between units. This converts between the selected unit in the list and the selected unit in the option menu. The menu contains the same units that are available in the list. Units are converted by specification of a quantity, in the entry next to the unit to convert from, followed by Enter.

For more information about variables, functions and units, see , and .

### Convert Number Bases Dialog

The number bases dialog, accessible from the File Menu or Ctrl B, is an efficient and convenient tool for conversion between binary, octal, decimal and hexadecimal numbers. This dialog contains entries for each number base. When a number is typed in any of the entries, the others are automatically updated to display the current number in their format. Numbers, or expressions, entered follow the same rules as expressions in the main expression entry.

#### Convert Number Bases Dialog

## Expressions

Expressions are mathematical statements. Mathematical questions are asked through expressions, which contains objects tied together with operators. The result of an expression may also be an expression, if the result is not a single object. Apples and oranges can be mixed, but the result will hold them apart. Qalculate! knows algebra.

### Objects

In Qalculate! mathematical entities, such as numbers and variables, are referred to as objects. The recognized object types are listed below.

Numbers

  These are the regular numbers composed by digits 0-9 and a decimal point — a dot, and a comma if it is the default decimal point in the locale/language used. Separators (ex. 1,000.00), usually comma or dot whichever is not the decimal point, are not allowed. Numbers include integers, real numbers, and complex numbers. The imaginary part of complex numbers are written with as regular number followed by the special variable i, which represents the square root of -1 (ex. 2 + 3i). Spaces between digits are ignored (5 5 = 55). E can be considered as a shortcut for writing many zeros and is equivalent to multiplication by 10 raised to the power of the right-hand value (ex. 5E3 = 5000). Sexagesimal numbers (and time) can be entered directly using colons (ex. 5:30 = 5.5). Numbers in other bases also be entered, either by using the `base()`, `bin()`, `oct()`, `hex()` and `roman()` functions, or by setting the base used for all numbers in the whole expression from Mode Number Base Set Base In Expression.

Vectors and Matrices

  A matrix is a two-dimensional rectangular array of mathematical objects. Vectors are matrices with only one row or column, thus one-dimensional sequences of objects, Vectors and matrices are generated by `vector()`, `matrix()` and similar functions, or stored in a variable. Syntax in the form of [1, 2, 3, 4] and [[1, 2], [3, 4]] can also be used.

Variables/Constants

  See .

Functions

  See .

Units and Prefixes

  Qalculate! understands abbreviated, plural and singular forms of unit names and prefixes. Prefixes must be put immediately before the unit to be interpreted as prefixes — 5 mm = 0.005 m, but 5 m m = 5 m^2. Also, for convenience units allow the power operator to be left out. A number following immediately after a unit is interpreted as an exponent (ex. 5 m2 = 5 m^2). This does not apply to currencies, as they might be put in front of the quantity. More information in .

Unknowns

  Unknowns are text strings without any associated value. If Qalculate! finds a character that are not associated with any variable, function or unit in an expression, then it will be regarded as an unknown variable. These are temporary unknown variables with default assumptions. Unknowns can also be explicitly entered by putting a text string in quotes. This is also necessary for undefined unknown variables with more than one character (ex.xy is just one object, while xy means x * y). See .

Text

  This category represent a number of different function argument types, such as regular text, dates and file names. They can, but do not need to be put in quotes except when containing the argument separator (, or ;).

To avoid confusion, functions, units, variables and unknown variables can independently be disabled.

Variables, functions and units are all accessible in the menus and in the variable, function and unit managers, If their names are not remembered. Functions accessed this way has some extra conveniences. If the function has at least one argument, a dialog will pop up where arguments can be entered and a description of the function and its arguments is available.

Qalculate! can handle most commonly used symbols for certain variables, functions and units, even though most are difficult to find on a keyboard. These include π for pi, √ for sqrt, € for euro, and so on. Most importantly it is possible to copy these symbols when used in the result.

For more information about variables, functions and units, see , and .

### Operators

The following operators are defined in Qalculate! and may be used in expressions.

#### Operators

Operation | Symbol | Description | Example | Result
--- | --- | --- | --- | ---
Addition | + | Adds the right value to the left value. | 1 + 1 | 2
Subtraction | − | Subtracts the right value from the left value. | 1 − 1 | 0
Multiplication | ⋅ or * | Multiplies the left value by the right value. | 2 * 2 | 4
Division | / | Divides the left value by the right value. | 2 / 2 | 1
Exponent | ^ | Raises the left value by the right value. Can also be typed as **. Note that x^y^z equals x^(y^z), and not (x^y)^z. | 2^3 | 8
10^x | E | Multiplies the left value with 10 raised to the power of the right value. Equivalent to the exponential number format in result display. E is as much an operator as part of numbers. | 1E3 | 1000
Parenthesis | ( and ) | Evaluates the expression in parenthesis first. | 5 * (1 + 1) | 10
Less than | < | Returns 1 for true, if the left value is is less than the right, and 0 for false. | 1 < 2 | 1
Greater than | > | Returns 1 for true, if the left value is greater than the right, and 0 for false. | 1 >2 | 0
Less than or equal | ≤ or <= | Returns 1 for true, if the left value is less than or equal the right, and 0 for false. | 1 <= 2 | 1
Greater than or equal | ≥ or >= | Returns 1 for true, if the left value is greater than or equal the right, and 0 for false. | 1 >= 2 | 0
Equals | = | Returns 1 for true, if the left value equals the right, and 0 for false. | 1 = 2 | 0
Not equals | ≠ or != | Returns 1 for true, if the left value not equals the right, and 0 for false. | 1 != 2 | 1
NOT | ! | Returns 1 for true, if the value to the right is false, and 0 for false. | !(1>2) | 1
OR | | | Returns 1 for true, if the right or left value is true, and 0 for false. | 1>2 | 2>1 | 1
AND | & | Returns 1 for true, if the right and left value is true, and 0 for false. | 1>2 & 2>1 | 0

In addition to these operators there are a couple of shortcuts for certain functions, such as 5! which equals factorial(5).

The multiplication sign can generally be left out. This is not true for numbers (5(5) = 25 but 5 5 = 55). Expressions can also generally be written with or without spaces with the same result (2xsin(2) equals 2 x sin(2) which equals 2*x*sin(2)), but be careful. The vast number of functions and units means that without separating spaces, the result might not be obvious. Also note that unit prefixes must be put immediately before the unit, to be interpreted as prefixes (5 mm = 0.005 m, but 5 m m = 5m^2).

Usually, mathematical expressions are written as normally expected. Standard operator precedence apply. Expressions are evaluated according to the following priorities:

1. Parenthesis

2. E (10^x)

3. Short multiplication in front of variables, units, functions, parenthesis etc. (ex. 5(2+3)). Note that this implies that 2/5 cm equals 2/(5 cm) and not (2/5) cm

4. Functions (ex. sqrt(2))

5. Exponents (x^y)

6. Multiplication and division (*, /)

7. Addition and subtraction (+, −)

8. Comparison (>, <, =, >=, <=)

9. AND (&)

10. OR (|)

## Calculator Modes

Qalculate! provides flexible calculation output and result display. There are several ways in which calculation output and display of results can be customized. These modes can generally be changed through the mode menu. Different modes are summarized below.

Number Bases

  Non-decimal bases can be selected for display of numbers in the result. This include regular number bases (binary, octal, hexadecimal, sexagesimal) as well as sexagesimal time format and roman numerals. All number bases between 2 and 36 can be selected from a dialog window accessed from Mode Number Base Other.... The base for entered numbers in expressions can be selected from the dialog opened with Mode Number Base Set Base In Expression. The convert number bases dialog (see ) is more efficient for other purposes.

Numerical Display

  These modes mainly control when numbers are displayed exponentially (ex. 2.62E3 which equals 2620). In the default normal mode, numbers are displayed in exponential format if the exponent will be greater than the current precision. In scientific mode the lowest exponent is 3. In simple numerical mode the exponential format is never used and it is always used in purely scientific mode. This is naturally equivalently true for numbers less than one and negative exponents. In scientific modes, division is shown as a negative power (ex. x * y^-1 instead of x / y).

Indicate Infinite Series

  If this option is on, Qalculate! will not round infinitely repeating digit sequences if discovered. Instead ... will be displayed after the maximal number of decimals and the result indicated as exact (compare 2/3 = 0.666667 with 2/3 = 0.666666...).

Round Halfway Number To Even

  With this option, halfway numbers will be rounded to even instead of upwards (ex. 2.65 is then rounded to 2.6 instead of 2.7). Note that this behavior is always applied in the `round()` function.

Show Ending Zeroes

  if this option is on, approximate numbers in the result will be appended with zeroes, so that the number of digits (after preceding zeroes) will equal the precision.

Fractional Display

  This controls if numbers are displayed in fractional or decimal mode. Decimal mode displays numbers as usually expected (6/4 = 1.5), combined displays a whole number and a fraction (6/4 = 1 1/2) and fractional only displays as fraction (6/4 = 3/2).

Unit Display

  The use of prefixes for units can be toggled on and off. By default prefixes representing a power of ten not dividable by three (centi, deci, deca and hekto) are not used and need to be enabled. If denominator prefixes are not explicitly enabled, prefixes will only be set for the numerator in a fractional unit expression (ex. 1 Mg/m or 1 kg/mm). The place units separately alternative controls the display of unit expressions in result. If it is enabled (default) units will be displayed separate from other parts of the expression at the end (compare (5x*m)/(y*s) and 5x/y m/s).

Abbreviate Names

  The display of unit, prefix, variable and function names can be controlled by selecting to display abbreviations or full length names (ex. 5 cm or 5 centimeters). Both abbreviations and long names can however always be entered in expressions.

Approximation

  When always exact mode is on, the calculation will not go further than what can be calculated exactly (ex. sqrt(2+3) = sqrt(5)). The default Try Exact mode, will calculate the result exact as far as possible and then approximately. Approximate mode will directly calculate a approximate result, thus being a bit faster but giving a less correct approximate indication (sin(pi/2) return approximately one instead of exactly one).

Assumptions

  This controls the default assumptions for unknown variables without explicitly defined assumptions. See .

Precision

  Precision controls the precision in approximate numbers and the number of significant digits. If the read precision options is turned on, input numbers with decimals will be interpreted as approximate with a precision equal to the number of digits (ex. 0.250 + 3.4567 = 5.96).

Decimals

  In the decimals dialog, the number of decimals displayed can be controlled. This includes minimal (will fill out with zeros) and maximal number of decimals (will round numbers).

## Variables

Variables are used to conveniently store a fixed value/result under a name. Variables can store everything that a result may contain, including numbers, units, variables, unsolved expressions and functions etc.

There two different kinds of variables known and unknown. Known variables represents a fixed value, usually a number, while unknown variables represents a range or type of values (ex. a non-negative integer).

Some common constants that can only be approximately represented by a real number, such as pi and e, are special known variables. They are not fixed but are recalculated each time precision changes, thereby not compromising the arbitrary precision of Qalculate!.

The ans variable, which always contains the last calculated result, is another special and useful variable.

The unknown variables x, y and z are predefined. They cannot be deleted, but changed. By default they use the default assumptions.

### Variable creation/editing

#### Store Result

The easiest way to create a known variable is to store the current result. This can be done by clicking the STO button or selecting File Store Result.... Type a name for the variable in the dialog that pops up and optionally enter a category and descriptive name to keep variables well organized.

Known variables can also be created from scratch by selecting File New Variable or by clicking New in the variable manager. The value can then be filled in, in the text field below the name, and specified as exact or approximate.

The dialog for creation of unknown variables are accessed by selecting File New Unknown Variable. Instead of a value, an assumed type and sign can then be entered.

Edit a variable by clicking Edit in the variable manager.

Variables stored in the Temporary category will not be saved after the program exit.

### Vectors and Matrices

Vectors and matrices are most effectively used stored in a variable. Qalculate! provides separate tools for these variables. They use a different dialog, where each element can be edited separately as in a spreadsheet. As with other variables, click Edit in the variable manager to edit a matrix/vector variable, but to create a new, select File New Matrix or File New Vector.

#### Matrix/Vector Edit Dialog

In this dialog, name, category and descriptive name are typed in as usual, but instead of a single value entry, the matrix/vector edit dialog has a table of entries. Select number of rows and columns above. In a vector this only determines how many value entries that are shown in the table and empty entries will be ignored. For matrices, each entry in the table is an element in the matrix. It is possible to switch between matrix and vector in the dialog (the menu item selected only determines the initial mode).

Matrices and vectors can also be loaded from data files. These files most be plain text files with values organized in separated rows and columns. Select File Import CSV File... and a dialog window pops up. First select the file to import and then specify whether if it shall be imported as a matrix or vectors. A name, descriptive name and category can optionally be typed in. If the name field is empty, the file name will be used instead. After that, the row in the file where the data starts should be specified. as well as whether this first row contains column headings. Finally the delimiter, used to separate columns in the file, must be selected. Click OK and variables will be generated from the file. If vectors are to be generated and the file contains more than one column, the name will be used as a subcategory and each variable will add the column heading (or Column 1, Column 2, ...) to the name and the descriptive name.

#### Import CSV Dialog

The `load()` function can be used to access a CSV file directly in an expression. The reversed action is also available with `export()`, or the dialog accessed with File Export CSV File... or from the variable manager.

## Functions

Functions are essentially mathematical formulas. They are used to store expressions with variable values, arguments. To execute a function, the values for a number of arguments need to specified. These arguments are then inserted into the expression, making it possible to calculate.

Functions is normally entered in an expression by writing the name followed by arguments, separated by commas (or semicolons in languages with comma as decimal point), in parenthesis, thus following the syntax `name(arg1, arg2, ...)`. Qalculate! will give a helpful error message if the arguments are not correct.

### Insert function dialog

The insert function dialog presents an easy way to insert a function and its arguments.

Although it can lower the readability of an expression, it is perfectly legal to skip the parenthesis and put the arguments after a space and end with a space or operator. This is most useful in short expressions with single argument functions (ex. sqrt 5).

Argument types include:

- Free — anything

- Number — a numeric value

- Integer — a whole number

- Symbol — a defined or undefined unknown variable

- Text — a free text string

- Date — a date in local or standard format (Year-Month-Day, recommended)

- Vector

- Matrix

- Boolean — 0 for false, 1 for true

- Object — the name of a variable, function or unit

- Variable — the name of a variable

- Function — the name of a function

- Unit — the name of a unit

- File — the path to a file

- Angle — an angle used in trigonometric functions, meaning a number and an angle unit. If no angle unit is included the default is used.

The argument can be restricted by further conditions. For example that a number must be positive.

### Available Functions

Here the main function categories and some of their members are described, to give an overview of available functions. The right place for a complete list and information about separate functions is however in the function manager.

Algebra

  Contains `sum()` and `productive()`, which corresponds to the sum and product signs. `solve()` solves equations (ex. solve(x * 2 = 8) returns 4 meaning that x equals 4).

Calculus

  Includes `diff()` which calculates the derivative of an expression with optional arguments with respect to (default x) and order (default 1).

Combinatorics

  Contains functions such as `perm()` for permutations, `comb()` for combinations, and `factorial()`.

Date & Time

  Includes `days()` and `yearfrac()` which returns the number of days and fractional years, respectively, between two dates.

Exponents & Logarithms

  Standard logarithmic and exponential functions. `ln()` calculates the natural logarithm of a number, while `log()` allows a choice of base as the second argument. The exponential functions does not really add anything beyond the capabilities of the exponential operator, ^.

Economics

  This essentially includes most of the financial functions that are usually found in spreadsheet applications.

Elements

  This category includes functions to retrieve data such as atomic weight. The `atom()` function opens a window with available data of an element. These functions accept the number, symbol or name of the element as argument. The data are loaded on demand.

Geometry

  Category with formulas mostly for calculation of circumference, area and volume of geometric shapes.

Logical

  Some procedural functions mainly for use in other functions. These include `if()`, which tests a conditional expression and returns a value depending on if the expression evaluates true or false, and `for()`, which processes a value while a condition is true.

Matrices & Vectors

  These are functions that generate, access and process matrices and vectors. The `vector()` function generates a vector from a variable number of arguments for components, while `matrix()` first needs the number of rows and columns and then the elements from left to right. Matrices can also be imported directly from a CSV file with `load()`.

  Separate elements at a specified row and column are accessed with `element()`. Other functions include `det()` for calculation of the determinant of a matrix and `inverse()` which returns the inverse of the given matrix, as well as functions such as `sort()` and `rank()`.

Miscellaneous

  A category for functions that do not fit elsewhere.

Number Theory

  Contains subcategories arithmetics, number bases, and rounding, in addition to functions such as `abs()`, which returns the absolute value of a number, and `gcd()`, the greatest common divisor. `round()` is the standard rounding function (note that halfway numbers are rounded to even). The functions for number bases translates a text string, representing an expression (bases that use letters does not allow variables, functions and units) with numbers in a different base, to a decimal number. Includes `bin()` for binary numbers, `hex()` for hexadecimal numbers, `oct()` for octal numbers and `base()` for numbers in a base between 2 and 36 specified in the second argument.

Statistics

  Contains a lot of functions for descriptive statistics and some statistical tests. Data sets are stored as vectors. Generally, functions with a vector/data set as last argument can take components/samples as a variable number of arguments directly instead of in a vector (ex. mean(1, 2, 3) equals mean(vector(1, 2, 3))). Also contains the `rand()` function, which returns a pseudo random number between 0 and 1, and does not take any arguments.

Trigonometry

  Trigonometric functions, including `sin()`, `cos()`, `tan()`, `sec()`, `csc()`, `cot()`, and hyperbolic and inverse versions of those. These functions take as argument an angle, with degrees, radians or gradians as unit. The default angle unit is used if the argument does not have a unit.

Utilities

  Various utility functions. Most are only useful in definition of other functions. The `save()` function can however be a quick way of storing a value in a variable, and `csum()` can be a powerful tool for data processing. This category also contains some functions, such as `char()` and `ascii()`, that might be useful for programmers. , `replace()` provides an easy way of replacing unknown variables by known expressions in a value (ex. replace(5x^2+x, x, 3) equals 5*3^2+3).

### Function creation/editing

Functions are a bit more complex than variables, but can nevertheless be relatively easily created. File New Function or click New in the function manager and the function edit dialog pops up. First enter a name, used to reference the function in an expression. If an expression is entered a bit further down, then the function will already be fully working. A bit more does however need to be said about the function expression.

The expression of a function is basically a normal expression with placeholders for arguments. These placeholders consists of a backslash and a letter — x, y, z for the 1st, 2nd and 3rd arguments and a to u for argument 4 to 24. These placeholders are replaced by entered arguments when a function is calculated. They naturally also decide the number of arguments that a function requires. For example the function for triangle area (base * height / 2) has the name triangle and the expression (\x*\y)/2, which gives that triangle(2, 3) equals (2*3) / 2 and returns 3 as result. An argument can be used more than one time and must not necessarily be in order in the expression.

#### Function Edit Dialog

Additionally, optional arguments can be put in the expression with upper-case (X, Y, Z, ...) instead of lower-case letters (x, y, z, ...). The default value can be put in brackets after the letter (ex. \X{2}). The default value may be omitted and is then zero. All additional arguments after an optional argument must also be optional.

A condition that must be true (>0) for the function to be calculated, can optionally be entered in the text field below the expression. This follows the same conventions as function expressions. For example if the second argument must be higher than the first, \y > \x may be entered as condition.

Further, name, type and condition for each argument can be specified.

The keep functions well organized, supply a category, descriptive name and description. A function can also hidden from menus with the corresponding check box, which can be useful for sub functions.

Global, system-wide functions can not actually be changed by the user, but if one of these functions is edited, they are deactivated and seemingly replaced by a new function. This way global functions can be deleted by deactivation. Some functions are however hard-coded and cannot be changed by the user.

## Units

Units give numbers meaning in the real world. They specify what is measured by the numbers and the scale used. Qalculate! fully incorporates units in calculations and includes all standard SI units as well as many non-standard local units.

### Currency

Among units, Qalculate! has support for currencies with up-to-date exchange rates. Currencies are normally referenced with the standard three letter code due to name clashes, but a number of currency unit can also be accessed through their regular name and symbol. U.S. dollars can, for example, be referenced both as USD and dollar/dollars, or with the $ symbol.

Wget must be installed on the computer for exchange rate updates to be enabled. Current exchange rates are automatically fetched from the European Central Bank on the Internet, the first time Qalculate! is started. By default the exchange rates will thereafter have to be updated manually from File Update Exchange Rates, unless automatic updates are enabled in the preferences dialog.

### Conversion

Expression can be converted to a specific unit directly in the expression entry with the to operator, which converts the left-hand expression to a specified unit (ex. 5 feet + 2 inches to cm converts the result of 5 feet + 2 inches to centimeters and displays it). Unit expressions may only contain units, prefixes, exponents, multiplication and division. Other elements are ignored.

The unit conversion dialog, accessible from the Convert button, Edit Convert To Unit Expression... or Ctrl T, can also be used. Enter a unit in the dialog that pops up, click Apply or OK and the displayed result is then converted.

#### Unit Conversion Dialog

The final way to convert to another unit is to use the predefined units in the Edit Convert To Unit menu or press Convert Result in the unit manager. Edit Set Prefix can be used to select a prefix.

It is also possible to let Qalculate! automatically convert the result to appropriate units with Edit Convert To Base Units and Edit Convert To Best Unit.

### Unit creation/editing

There are three different unit classes in Qalculate! — base, alias and composite units. Base units are units defined as basis for other units. Meters and seconds are typical base units. Alias units is defined in relation to another unit, for example hour are defined as an alias unit that equals 60 minutes which in turn is defined in relation to seconds. Finally, composite units are defined by a unit expression with multiple units. Composite units often have an alias unit associated with them, as they do not have a reference name on their own. For example, a joule is defined as an alias defined in relation to a composite unit defined as Newton * meter.

Select File New Unit, or click New in the unit manager, and the unit edit dialog pops up.

#### Unit Edit Dialog

First the unit class needs to be selected. Depending on the unit class, different elements in the dialog will be enabled. For all units, category and descriptive name can be specified to keep them well organized. A unit can also be hidden from unit menus with the corresponding check box, which can be useful for some composite units.

Base and alias units may have three different name forms defined for use in expressions — short (ex. m), singular (meter) and plural (meters). At least the short name must be specified. Composite units only have an (mandatory) internal name, used to reference the unit in definitions of other units.

For base units, the name is all that is needed. For alias units, on the other hand, a base unit, exponent and relation are necessary. For more complex relations a reversed relation can also be specified for conversion back from the base unit. The base unit must not necessarily be of the base unit class and it is recommended that an alias unit is defined in relation to the closest unit (ex. 1ft = 3 hands, 1 hand = 4 in, and 1 in = 0.0254 m). The relation is usually just a number that tells how large quantity of the base unit is needed to get the alias unit (alias unit = base unit * relation). More complex units can specify the relation as a full-blown expression where \x is replaced by the quantity of the base unit and \y is the exponent. For example Degrees Celsius has the relation \x + 273.15 and the reversed relation \x − 273.15 to the base unit Kelvin. For simple relations, the reversion is automatic and ought not be defined separately, The check box below relation in the dialog specifies if the relation is exact or approximate. The exponent defines the exponential relation to the base unit, so that the alias unit equals the base unit raised to the exponent. For simple unit relations this gives: alias unit = relation * base unit^exponent.

Composite units need a unit expression with multiple units as base, in the base unit field. These expressions may only contain units, prefixes, exponents, multiplication and division (ex. km/h).

## Plotting

Plotting in Qalculate! is done through an external program, Gnuplot. Thus Gnuplot (>= v. 3.7) need to be installed on the computer for plotting to work.

To plot functions or data sets, select File Plot Functions/Data, which brings up the plot dialog. The plot dialog consists of two tabs/pages — the first for the data and the other for control of function sampling and appearance.

### Plot Data

Plot functions are normal expressions that represents f(x) in y=f(x) (ex. sin(x)). The x can be specified as a different text string in the variable entry below the function/data list. Note that the x in the expression is an unknown variable and follows associated rules, meaning that if x is replaced by a string with more than one letter it must be put in quotes in the expression. Also, the x must not clash with an existing variable, function or unit. To avoid these problems, use a backslash as the first character in the x string.

To plot a data set, enter an expression that results in a matrix or vector. Select Vector/Matrix below and vectors will appear as one series and matrices will appear with each column or row (if selected) as a series, If the paired matrix option instead is selected, the first column/row of the matrix will constitute the y-values and the second the x-values.

Type in an expression, press Enter and a new window will open with the plot. The title of the series, the diagram style and smoothing of the line can also be set. The series modified must be selected in the list and to apply changes click Apply. More series that will appear in the same plot window can be added. If the scale of the y values differ, series can be put on a secondary y-axis.

Even though Qalculate! does all the calculations before handing over the data to Gnuplot, the resulting data must only consist of pure numbers, as Gnuplot knows nothing about the functions, variables, units, etc. of Qalculate!.

### Plot Settings

For functions, the function range — min and max x value, and the number of y values calculated — can be specified.

A title can be set to appear at the top of the plot, as well as labels for the x and y axis. The appearance can also be controlled by selecting or disabling legend placement, displaying/hiding the grid and borders on the top and the right side of the diagram and choosing color or monochrome graphics. The x and y scales can be made logarithmic by clicking the box on the right and filling in a desired logarithmic base.

To update the plot window, click Apply at the bottom of the dialog.

### Gnuplot

The plot can be saved as an image file. Click Save and select a file name and folder. The extension of the file name will decide the file type (.png for PNG image, .svg for SVG, .ps for postscript, .eps for encapsulated postscript, .tex for LaTeX, and .fig for XFig). Default is to save as a PNG image.