bt_math

Crates.iobt_math
lib.rsbt_math
version0.3.1
created_at2024-11-19 09:16:23.360424+00
updated_at2025-03-17 03:16:21.880676+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
size21,850
(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.
  • 0.3.1
    • Move to Rust 2024 Edition

License

GPL-3.0-only

Commit count: 0

cargo fmt