Crates.io | qalqulator |
lib.rs | qalqulator |
version | 0.1.0 |
source | src |
created_at | 2022-10-14 02:48:27.404293 |
updated_at | 2022-10-14 02:48:27.404293 |
description | A calculator that uses (and outputs) rational numbers wherever possible. |
homepage | |
repository | https://github.com/Gadiguibou/qalqulator/ |
max_upload_size | |
id | 687882 |
size | 68,186 |
A calculator that uses (and outputs) rational numbers wherever possible.
The only operation that causes the output to revert to a floating point is exponentiation with fractional exponents.
Install Rust.
Run the following command in your terminal:
cargo install qalqulator
Pre-built binaries are available on the releases page.
$ qalqulator
>>> 6 * 7
42
>>> (12/11)^(4/2)
144/121
>>> let x = 141 % 100
41
>>> x + 0.5
83/2
>>> to_float(x) + 1/2
41.5
>>> x^(1/2)
6.4031242374328485
>>> exit
+
-
*
/
%
^
42
), floating point numbers (42.0
), or fractions (42/1
) and will be automatically converted to rational numbers.let
keyword. For example, let x = 42
will assign the value 42 to the variable x
.to_float
function. For example, to_float(83/2)
will return 41.5
.exit
or Ctrl+D.This is a toy project that I built for my own needs over the course of a few hours. If you find it useful and would like to see additional features, please open an issue or a pull request.
Qalqulator is a calculator over $\mathbb{Q}$, the set of all rational numbers.