- Zig 100%
| demo | Removed obsolete example | |
| man | Moved all doc/items to man page, improving the said page in the process. | |
| src | Implemented clipboard paste with Spiral editor | |
| .gitignore | Removed old build system | |
| build.zig | Updated version to 1.1.1 | |
| build.zig.zon | Updated version to 1.1.1 | |
| CHANGELOG.md | Moved version 1.1.1 | |
| examples.md | Basic editing? What? | |
| LICENSE | Got rid of doc/ directory | |
| README.md | Basic editing? What? | |
Overview
lcalc — a command Line Calculator with arbitrary precision, inspired by bc and empowered by a family of GMP libraries. It can both be used in scripts, for medium–sized calculations, as well as in terminal with a nice CLI.
Features
- Line-by-line calculation of mathematical expressions.
- Integer (
4), rational (7/3), floating (2.3) and complex (2 + 3i) numbers powered by GMP, MPFR and MPC. - Binary, (
+,*,/, ...), unary (-, ...) operators. - Variables:
x = 5. - Predefined constants:
piorπ,e, and more. - Predefined functions:
max(1, 2),sin(pi), ... - User–defined functions:
csc(x) = 1/sin(x) - Intuitive syntax that's close to a math notation:
3x (2sin(z) / 4y) - Numbers in different bases: hexademical (
0xFF), binary (0b10110), octal (0o777). - Modern, but simple interface with interactive editing powered by Spiral, syntax highlighting and themes.
Demonstration
See examples for a visual showcase.
Installing
Downloading a release
See releases page.
Every release comes with precompiled executable for specific OSes available for download. This executable is statically linked: this means it doesn't have system dependencies, but weights more.
Releases may also contain minisign signatures that can be verified with the following public key:
RWTW/iadZl5EZQtwd5E0HKfXXzjq6ePMGtKhz5VAPm7VLJHz19URs69p
Building from source
This project uses Zig build system, version 0.14.0.
For instructions, refer to the Zig build system documentation.
The build process depends on system libraries GMP, MPFR, MPC and Spiral (version 0.3.0).
To change the installation prefix (by default it's zig-out):
zig build --prefix ${PREFIX}
To generate and install man pages, Pandoc is required:
zig build man
License
This is a free software released under the GNU General Public License 3.0.
This software is provided as is, with no warranty.
Author
lch361 (a. k. a. Lich)
Like this project? Follow my other work at https://lch361.net!