Crates.io | mini-calc |
lib.rs | mini-calc |
version | 3.2.0 |
source | src |
created_at | 2023-11-12 11:20:26.146462 |
updated_at | 2024-06-05 19:35:35.13984 |
description | A fully-featured minimalistic configurable rust calculator |
homepage | https://calc.nwa2coco.fr |
repository | https://github.com/coco33920/calc |
max_upload_size | |
id | 1032663 |
size | 387,624 |
You can install the latest version from source
git clone https://github.com/coco33920/calc
cd calc
cargo build --release
./target/release/mini-calc
cargo install mini-calc
Alternatively, you can use nix to build or run this project.
Running directly:
nix run github:coco33920/calc
You may need to enable nix experimental features. In that case, execute the following command:
mkdir -p ~/.config/nix && echo "experimental-features = nix-command flakes" | tee ~/.config/nix/nix.conf
Both .deb
and .rpm
packages are availables in the
The website (powered by oranda) is available for more informations the website for more informations.
If you prefer a PDF, there is a manual
Name | Role | Website | |
---|---|---|---|
Charlotte THOMAS | Main developer/Maintener | Main page | |
Léana 江 | Help, cleanup | Website/Blog | |
Sigmaficient | Nixify | Website |
The TODO list is completed so I collapsed it
>=
>
<=
<
==
Plot functions (both stdlib, and runtime) would be useful and appreciated. Plotting is powered by gnuplot, it will works on Unix-like (MacOS, Linux) but I don't have any idea about Windows
Plot stdlib functions
[X] Plot runtime functions
Save plot to png/svg/pdf
Add terminal ploting
Auto level x axis in termplot
Auto level y axis in termplot
You can plot function defined in the standard library of calc or user defined functions, to display the help just type plot()
You can then plot for example
Plotting cos with the default values (from 0 to 3pi, with a step of 0.01pi)
Plotting sin with custom values (from -pi to pi, with a step of 0.01rad, with line, title, x label, y label)
Defining f(x) = x² and plotting it with custom values (from -10 to 10, with a step of 0.1, with linespoint)
You can plot in the terminal, for example
And it supports the labels too
And now it auto scales on y!
As this project provides a frontend with a parser we could plug an exact math engine in the backend to transform calc
into a
real exact math calculator.
TODO List for the Exact Math Engine
As of 2.11.0 the support for rational exact math has been implemented
As of 2.11.1 it works in matrices!
As of 2.11.4 floats are automatically rationalized (with 10 decimal points of precision)
If we ever go to this step, yes, I will remove the "minimalistic" from the description
You can configure the general color, greeting message, greeting color, prompt and prompt color from the file for example in (for linux)
~/.config/mini-calc/mini-calc.toml
Or situated in your operating system config folder.
You can interact with the configuration with the command line, more info in the web page
The default configuration looks like this
Available colors are
Default colour (if the configuration fail to load) is Cyan.
Configuration:
It looks like:
The following functions are available
For trigonometry, the input are assumed to be in radian, if not, you have to put "false" or "true" as second argument, example shown bellow
If you use the exp function you can pass a second argument for the base you are using, if no second arguments are passed this is assumed to be in natural base
You can take the nth root with the sqrt function, by default it takes the second root.
You can round to the nth decimal with the round function, by default it round to the integer (floor)
Function are now vectorized! Just pass a vector as an argument!
You can now use logic! I implemented the following functions:
>=
)>
)<=
)<
)==
)Example:
You can define your own functions!
You can use vectors!
norm
function to compute the normFunctions added:
As of 2.7.0 matrix algebra is implemented (using lup reduction)
functions added
As of 2.11.3 matrices are pretty printed !
As of 2.12.0 non interactive use was added