Crate sci_calc

Source
Expand description

An simple, comprehensive scientific calculator library

An easy-to-use scientific calculator crate that evaluates mathematical expressions in strings. Includes variable assignment and recall, comprehensive built-in functions and constants, and elegant error handling. The calculate() function is passed a Context object that is used for keeping state between calculations such as user-defined variables.

§Example

let mut ctx = Context::new();
assert_eq!(calculate("5 + 5", &mut ctx), Ok(10.0));

Modules§

context

Structs§

CalcError
Custom error handling struct

Enums§

CalcErrorType
Error types

Functions§

calculate
Attempts to calculate a string containing a mathematical expression