Calculator
A calculator working purely with text inputs.
Downloading
- Desktop Version (Windows + Mac) available in the
Releases
Tab - Web Version available here!
Features
- GUI and CLI applications
- Literals in decimal, hex and binary
- The integer part of floats can be omitted
- Basic operators (
+ - * /
) - Extended operators (
^
, Bitwise operators, ...) - Groups and nested groups (
(2 + 2) * 2
) - Functions (such as
sin
orcos
)- Custom Functions (
f(x) := 3x
)
- Custom Functions (
- Variables
- Builtin variables such as
pi
ore
ans
variable, holding the result of the last computation- Custom variables (
x := 3 + 4
)
- Builtin variables such as
- Inferred multiplication before groups, functions and variables (
2pi
) - Number modifiers (such as
!
for factorial or Bitwise NOT or%
as a shorthand forn / 100
) of
operator for taking a percentage from a number- Equality checks (
4 = 2 * 2
) - Units
- Unit suffixes such as (
m
,lb
or°C
) - Unit prefixes such as (
k
(Kilo),g
(Giga), orm
(Milli))
- Unit suffixes such as (
in
operator- Conversion between units
- Conversion between representations (if last thing in line)
- Plotting single argument functions in the GUI
- Web version + PWA (downloadable website)
Order of operations
- Functions and variables
- Groups
- Extended operators
- Multiplication and division
- Addition and subtraction
of
andin
Building
- Clone the project with
git clone https://github.com/david072/calculator
cd calculator
- Run the CLI version with
cargo run --bin cli
or the GUI version withcargo run --bin gui
While it should also work on Linux, it has only been tested on Windows and Mac so far.
TODO
- Complex units such as
km/h
- Constructs such as the unit
W
being constructed from the unitsV
andA
Contributing
You can contribute either by using the application and reporting issues and submitting feature requests, or by forking the project and working on it yourself.