moo-math 0.1.1

A simple math interpreter
Documentation
  • Coverage
  • 0%
    0 out of 24 items documented0 out of 7 items with examples
  • Size
  • Source code size: 40.87 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.35 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • boon4681/moo-math
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • boon4681

Moo-Math

 _(_)_

'-e e-'

 (o_o)


What does the cow sound like?

It's moo~ moo moo

Mathematics interpreter utility, written without dependencies, capable of

  • Interpreting normal mathematics equation
  • Interpreting first order differential equation with Runge-Kutta method
  • Can add custom math function

Example

fn main(){
    let mut moo = Moo::new(|functions| {
        // add custom function
        functions.insert("relu", |v| {
            f64::max(0.0, v)
        });
    });
    let program = moo.parse("x + 10 + relu(-6)").ok().unwrap().unwrap();
    // run(x) output: 10
    println!("{}", program.run(0.0));
}