| 1 |
Qalculate! library and CLI |
| 2 |
|
| 3 |
Qalculate! is a multi-purpose cross-platform desktop calculator. It is simple |
| 4 |
to use but provides power and versatility normally reserved for complicated |
| 5 |
math packages, as well as useful tools for everyday needs (such as currency |
| 6 |
conversion and percent calculation). Features include a large library of |
| 7 |
customizable functions, unit calculations and conversion, symbolic calculations |
| 8 |
(including integrals and equations), arbitrary precision, uncertainty |
| 9 |
propagation, interval arithmetic, plotting, and a user-friendly interface (GTK+, |
| 10 |
Qt, and CLI). |
| 11 |
|
| 12 |
1. Requirements |
| 13 |
|
| 14 |
* GMP and MPFR |
| 15 |
* libxml2 |
| 16 |
* libcurl, icu, gettext (recommended) |
| 17 |
* iconv, readline (recommended for CLI) |
| 18 |
* Gnuplot 1.7 (optional) |
| 19 |
* doxygen (optional) |
| 20 |
|
| 21 |
For Linux distributions which provide separate development packages, these must |
| 22 |
be installed for all the required libraries (e.g. libmpfr-dev) before |
| 23 |
compilation. |
| 24 |
|
| 25 |
2. Installation |
| 26 |
|
| 27 |
In a terminal window in the top source code directory run |
| 28 |
|
| 29 |
* ./autogen.sh (not required if using a release source tarball, only if using |
| 30 |
the git version) |
| 31 |
* ./configure |
| 32 |
* make |
| 33 |
* make install (as root) |
| 34 |
* ldconfig (if necessary, as root) |
| 35 |
|
| 36 |
If libqalculate is installed in /usr/local (default) you may need to add |
| 37 |
/usr/local/lib to the library path of the system (add /usr/local/lib to a file |
| 38 |
under /etc/ld.so.conf.d/ and run ldconfig). |
| 39 |
|
| 40 |
3. API Documentation |
| 41 |
|
| 42 |
The API documentation is included in the package and is installed in |
| 43 |
$docdir/libqalculate/html (usually /usr/share/doc/libqalculate/html). |
| 44 |
It is generated when running autogen.sh. |
| 45 |
|
| 46 |
It is also available online at reference/index.html. |
| 47 |
|
| 48 |
4. Using the CLI program "qalc" |
| 49 |
|
| 50 |
To calculate a single expression from the command line (non-interactive mode) |
| 51 |
enter "qalc EXPRESSION" (e.g. qalc 5+2) |
| 52 |
|
| 53 |
"qalc --help" shows information about command line options in non-interactive |
| 54 |
mode. |
| 55 |
|
| 56 |
If you run "qalc" without any mathematical expression the program will start in |
| 57 |
interactive mode, where you can enter multiple expressions with history and |
| 58 |
completion, manipulate the result and change settings. |
| 59 |
|
| 60 |
Type "help" in interactive mode for more information. |
| 61 |
|
| 62 |
A man page is also available (shown using the command "man qalc", or online at |
| 63 |
https://qalculate.github.io/manual/qalc.html). |
| 64 |
|
| 65 |
5. Other Applications |
| 66 |
|
| 67 |
The main user interfaces for libqalculate are |
| 68 |
qalculate-gtk (https://github.com/Qalculate/qalculate-gtk) and |
| 69 |
qalculate-qt (https://github.com/Qalculate/qalculate-qt). |
| 70 |
|
| 71 |
Other software using libqalculate include |
| 72 |
* Qalculator web app (https://qalculator.xyz/) (also available as apps for Android, iOS, and Windows) |
| 73 |
* Qalculate for Android (https://github.com/jherkenhoff/qalculate-android) |
| 74 |
* KDE Plasma Workspace (https://www.kde.org/workspaces/plasmadesktop/) |
| 75 |
* Cantor (http://kde.org/applications/education/cantor/) |
| 76 |
* Step (http://kde.org/applications/education/step/) |
| 77 |
* Qalculate widget for KDE Plasma (https://store.kde.org/p/1155946/) |
| 78 |
|
| 79 |
|
| 80 |
6. Features |
| 81 |
|
| 82 |
General |
| 83 |
* All common operators — arithmetic, logical, bitwise, element-wise, (in)equalities |
| 84 |
* Expressions may contain any combination of numbers, constants, functions, units, variables, matrices, vectors, and time/dates |
| 85 |
* Fault-tolerant and flexible input parsing with verbose error/warning messages |
| 86 |
* Calculate as you type |
| 87 |
* Arbitrary precision with both rational and floating point numbers |
| 88 |
* Complex and infinite numbers |
| 89 |
* Propagation of uncertainty and interval arithmetic |
| 90 |
* Both exact and approximate output (sqrt(32) = 4 * sqrt(2) ≈ 5.657) |
| 91 |
* Simple and mixed fractions (4 / 6 * 2 = 1.333... = 4/3 = 1 + 1/3) |
| 92 |
* All common number bases, as well as negative and non-integer radices, roman numerals, etc. |
| 93 |
* RPN mode |
| 94 |
* Highly customizable with a myriad of options for every aspect of the calculator |
| 95 |
|
| 96 |
Symbolic calculations |
| 97 |
* Factorization and simplification |
| 98 |
* Differentiation and integration |
| 99 |
* Can solve most equations and inequalities |
| 100 |
* Customizable assumptions (e.g. ln(2x) where x > 0 = ln(2) + ln(x)) |
| 101 |
|
| 102 |
Functions |
| 103 |
* Over 400 flexible and diverse functions (trigonometry, exponents and logarithms, combinatorics, geometry, calculus, statistics, finance, time and date, etc.) |
| 104 |
* Easily created and edited from the user interfaces, with support for different argument types, subfunctions, and custom conditions |
| 105 |
|
| 106 |
Units |
| 107 |
* Over 400 diverse units and all standard decimal and binary prefixes |
| 108 |
* Includes all SI units, as well as imperial, CGS, and atomic units, and more... |
| 109 |
* Automatic and explicit conversion (e.g. ft + yd + m = 2.2192 m, 5 kg * m/s^2 = 5 N, 5 m/s to mph = 11.18 mph) |
| 110 |
* Currency conversion with daily updated exchange rates |
| 111 |
* Easily created and edited from the user interfaces |
| 112 |
|
| 113 |
Variables and constants |
| 114 |
* All common basic constants (pi, e, etc.) |
| 115 |
* Fundamental physical constants with 2022 CODATA values (including standard uncertainy and optional units) |
| 116 |
* CSV file import and export |
| 117 |
* Easily created and edited from the user interfaces (including by direct assignment, e.g. x = 2 s) |
| 118 |
* Data sets with objects and associated properties in database-like structure (data set with chemical elements is included) |
| 119 |
|
| 120 |
Plots and graphs |
| 121 |
* Uses Gnuplot |
| 122 |
* Can plot functions or data (matrices and vectors) |
| 123 |
* Can be customized using several options, and saved as image files |
| 124 |
|
| 125 |
...and more... |
| 126 |
|