A calculator working with text.

Overview

Calculator

A calculator working purely with text inputs.

Image

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 or cos)
    • Custom Functions (f(x) := 3x)
  • Variables
    • Builtin variables such as pi or e
    • ans variable, holding the result of the last computation
    • Custom variables (x := 3 + 4)
  • Inferred multiplication before groups, functions and variables (2pi)
  • Number modifiers (such as ! for factorial or Bitwise NOT or % as a shorthand for n / 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), or m (Milli))
  • 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

  1. Functions and variables
  2. Groups
  3. Extended operators
  4. Multiplication and division
  5. Addition and subtraction
  6. of and in

Building

  1. Clone the project with git clone https://github.com/david072/calculator
  2. cd calculator
  3. Run the CLI version with cargo run --bin cli or the GUI version with cargo 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 units V and A

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.

Comments
  • Implement periodic table

    Implement periodic table

    It would be useful for users calculating chemical formulas needing e.g. information, such as ordinal number, mass, molar mass

    The elements of the periodic table can be accessed through PT(ordinal number) (output is the name of the element) / PT(name of element) (output is ordinal number of the element) and henceforth be used by PT(ordinal number).m (mass) / PT(ordinal number).Mm (molar mass) / PT(ordinal number).Vm

    enhancement 
    opened by M475R 1
  • feat: pr-pages workflow

    feat: pr-pages workflow

    This workflow runs whenever a new pr is opened and deploys the changes on GitHub pages. To do that, it creates a new directory called "pr" in the gh-pages branch, which then contains the new files.

    opened by david072 0
  • Generate unit conversion data from file

    Generate unit conversion data from file

    A unit conversion Rust file is now generated automatically from the /calculator/unit_data.txt file. This makes it way easier to maintain them since it is easier readable, as well as allowing anyone, even people who don't know Rust, to add units and their conversions.

    opened by david072 0
  • Installers

    Installers

    This adds an msi installer for Windows and a .dmg "installer" for MacOS to the GUI application. These are built in CD, meaning they will end up in releases. These installers make it easier to distribute the applications, since the user does not have to worry about setting up the environment.

    opened by david072 0
  • Discord bot

    Discord bot

    This adds a Discord bot with the following functionalities:

    • Ability to calculate a string with /calc <text>
    • Updates currencies periodically
    • Sessions:
      • Sessions are a way to do successive calculations and use the results of the previous calculations (e.g. functions) (in Discord threads)
      • Create sessions with /session new <name>
      • Delete sessions with /session delete <name> ( can be omitted if invoked from inside the session thread)
      • Sessions are persisted across bot restarts to prevent having "ghost" threads
    opened by david072 0
  • Currency support

    Currency support

    This adds support for currencies as units. The application now fetches the currency conversions from an API and stores them on desktop (see FIXMEs for WASM). Default conversions are also generated in build.rs during build time and stored in the file src/calculator/environment/default_currencies.rs and act as a fallback.

    opened by david072 0
Releases(v1.2.0)
Owner
null
CLI calculator app and library

calc Yet another CLI calculator. Inspired by the excellent https://github.com/alfredxing/calc. Installation With a Rust toolchain in place: cargo inst

Peter Goodspeed-Niklaus 34 Nov 13, 2022
Cork is a simple command-line calculator, mainly targeted towards people who deal with hex numbers

Cork is a simple command-line calculator, mainly targeted towards people who deal with hex numbers. It deals only with integer arithmetic. Expressions may involve mixed bases (limited to decimal, hexadecimal, octal and binary numbers). The global output format may be set to a particular radix - by default it is hex.

Deep Majumder 50 Dec 22, 2022
A simple command line based RPN calculator

stak A simple command line based RPN calculator Usage stak can be used in two modes: one-shot from the command line, or in an interactive shell One-sh

null 1 Nov 17, 2021
a (soon to be) calculator frontend and a (soon to be optimizing) toy IR backend

Zach-Calc Zach-Calc is a pet project for me to try and better understand pattern matching, optimization, IRs, and the likes. ./libs/* contains librari

Zachary Petti 0 Jan 6, 2022
Simple calculator REPL, similar to bc(1), with syntax highlighting and persistent history

eva simple calculator REPL, similar to bc(1), with syntax highlighting and persistent history installation Homebrew $ brew install eva crates.io $ car

Akshay 632 Jan 4, 2023
An Intel HAXM powered, protected mode, 32 bit, hypervisor addition calculator, written in Rust.

HyperCalc An Intel HAXM powered, protected mode, 32 bit, hypervisor addition calculator, written in Rust. Purpose None ?? . Mostly just to learn Rust

Michael B. 2 Mar 29, 2022
A CLI calculator written in Rust that isn't blazingly fast.

Calcamabob A command line calculator Is written in Rust Is not blazing fast, and could be faster. Calcamabob can interpret operator precedence. For ex

Casey Kneale 4 Oct 24, 2022
A simple calculator, Rust implemention.

Calc A simple calculator. Usage If the name of the binary is calculator, To calculate: $ calculator -c <EXPRESSION> # or $ calculator --calc <EXPRESSI

Umoho Qerty 2 Aug 7, 2022
🧮 Terminal RPN calculator

Calc final name pending Reverse Polish notation calculator for the console. Vaguely modelled after PCalc. Features Reasonable, opinionated set of oper

Robin Schroer 4 Dec 14, 2022
osu!Skills calculator rewritten in rust.

osu!Skills rs osu!Skills calculator rewritten in rust. Usage osu_skills_rs [OPTION]... Skill Calculator Mandatory: --in=FILE: Path to .osu file to pa

null 2 Dec 18, 2022
A simple command-line calculator program writen with Rust.

Calculator.rs An simple command-line calculator program writen with Rust. Features Math functions support > sin(1) = 0.84147098 Variable support > a

BHznJNs 33 Apr 8, 2023
An interactive Bayesian Probability Calculator CLI that guides users through updating beliefs based on new evidence.

Bayesian Probability Calculator CLI Welcome to the Bayesian Probability Calculator CLI! This command-line tool is designed to help you update your bel

Ben Greenberg 4 Apr 25, 2023
A complex numbers, graphing, cli calculator

calc requires gnuplot for graphing history file is stored in ~/.config/.calc_history or C:\\Users\\%USERNAME%\\AppData\\Roaming\\calc.history usage Us

null 6 May 21, 2023
TI-89-style calculator, maybe turing complete

I will make a fully capable graphing calculator in Rust and you can't stop me. As always, I'm not using libraries or any of that. Everything here is h

Neptunal 4 Jun 2, 2023
Command Line Scientific Calculator. Free Forever. Made with ❤️ using 🦀

██████╗███████╗ ██████╗ ██╔════╝██╔════╝██╔════╝ ██║ ███████╗██║ ██║ ╚════██║██║ ╚██████╗███████║╚██████╗ ╚═════╝╚══════╝ ╚═════╝ -

zahash 17 Oct 28, 2023
Calc: A fully-featured minimalistic configurable calculator written in Rust

Calc Calc: A fully-featured minimalistic configurable rust calculator Install You can install the latest version from source git clone https://github.

Charlotte Thomas 4 Nov 15, 2023
🎙 A compact library for working with user output

?? Storyteller A library for working with user output Table of contents ?? Introduction ?? Visualized introduction ?? Example source code ❓ Origins ??

Martijn Gribnau 30 Dec 7, 2022
Utilites for working with `bevy_ecs` when not all types are known at compile time

bevy_ecs_dynamic Utilities for working with bevy_ecs in situations where the types you're dealing with might not be known at compile time (e.g. script

Jakob Hellermann 17 Dec 9, 2022
A workflow tool for quickly running / testing something you are working on

runfast What is it? This is a program intended to be run in a project directory to set up a project run command, and remember it so we dont have to ty

anna 4 Dec 16, 2022