From e98f0b8cdc78b8a43d66d4ea283e994f27aa46bc Mon Sep 17 00:00:00 2001 From: Valerie Date: Wed, 14 Jun 2023 12:12:54 -0400 Subject: [PATCH] updated README --- README.md | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ed4501b..a92d2ed 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,42 @@ # quickmaths -A small Rust program that can do common math from the command line. +A small, pretty command line calculator. -I got VERY tired of opening a calculator or a full Python interpreter to do simple math, so I initially created `quickmaths` in Python to do math from the command line. +Features expression evaluation, variable assignment, an interactive mode, pretty +output, and a variety of preset constants and functions focused on pure mathematics, +data science, and computer science. -As the features I wanted changed, such as variable assignment, interactive mode, and output status and formatting, I decided to rebuild the utility in Rust. +## Constants + +| Name | Tokens | Type | Value | +-------------------------------------------------------------- +| Euler's Number | `e` | f64 | `2.718281828459045` | +| Golden Ratio | phi, ϕ | f64 | `1.618033988749895` | +| Pi | pi, π | f64 | `3.141592653589793` | +| Root Two | √2 | f64 | `1.414213562373095` | +## Built-in functions + +### Mathematics + +- `fix`: fix a float to *n* digits. +- `log`: logarithm. Defaults to natural logarithm (ln). +- `sqrt`/`√`: square root. + +### Data Science + +- `avg`: average an arbitrary set of numbers. + +### Computer Science + +- `bin`: convert an integer to a binary string or vice versa. +- `hex`: convert an integer to a hexadecimal string or vice versa. +- `oct`: convert an integer to an octal string or vice versa. + +## Libraries + +- [evalexpr](https://crates.io/crates/evalexpr) +- [termion](https://crates.io/crates/termion) +