bt_math

Crates.iobt_math
lib.rsbt_math
version
sourcesrc
created_at2024-11-19 09:16:23.360424+00
updated_at2025-02-16 20:01:48.039085+00
descriptionBasic math expression evaluator library. Support basic math operators (+,-,*,/,^), parenthesis, and functions such as log10, ln, log2, exp, sin, cos, tan, asin, acos, atan, abs, sqrt. Support PI and E (Euler's number) as constants. Support negative numbers/expressions. Pow(x,y) supported
homepagehttps://github.com/bachuetech/bt_math
repositoryhttps://github.com/bachuetech/bt_math.git
max_upload_size
id1453045
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
(bachuetech)

documentation

README

Project Title

BT MATH

Description

A simple implementation of an expression evaluator that can handle basic arithmetic operations, parentheses, and some mathematical functions that provide a way to evaluate mathematical expressions using RPN (Reverse Polish Notation) implemented in two parts: parsing and evaluation.

Support the use of PI and E (Euler's number), negative numbers or expressions, and the following functions: ln, log2, exp (e^#), asin, acos, atan, sin, cos. tan. abs, sqrt. log10

Usage

let expression = "2 + 3 * 4";
 .......
let f = evaluate_expression(expression).unwrap();

Version History

  • 0.1.0
    • Initial Release
  • 0.2.0
    • Added PI and E (Euler's number) support. Support for negative numbers. Fix error with log (log was removed) and added log10.
  • 0.3.0
    • POW(x,y) is a function now supported. Also fix some negative number issues. Make it case insensitive.

License

GPL-3.0-only

Commit count: 7

cargo fmt