pemel

Crates.iopemel
lib.rspemel
version0.2.1
created_at2025-01-22 19:52:57.063616+00
updated_at2025-03-08 13:20:38.586122+00
descriptionParsing and Evaluating of Math Expressions Library
homepagehttps://github.com/MikulasBar/pemel
repositoryhttps://github.com/MikulasBar/pemel
max_upload_size
id1527052
size37,951
(MikulasBar)

documentation

README

PEMEL

Crates.io License

Overview

pemel is a Rust library providing a utilities for parsing and evaluating mathematical expressions.

Features

  • Basic arithmetic operations
  • Trigonometric functions
  • Exponential and logarithmic functions
  • Absolute value function
  • Evaluation with multiple variables
  • Numeric derivatives
  • Implicit evaluation during parsing
  • Substitution

Usage

Here is a simple example of how to use pemel:

use pemel::prelude::*;

fn main() {
    let input = "2 * x^2 - 5 * log(x)";
    let expr = Expr::parse(input, true).unwrap();
    let result = expr.eval_with_var("x", 10.0).unwrap();

    println!("{}", result); // Output: 195.0
}

Contributing

Untill I create a CONTRIBUTING.md file, I will not accept any pull requests.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Commit count: 136

cargo fmt