| Crates.io | moo-math |
| lib.rs | moo-math |
| version | 0.1.1 |
| created_at | 2023-09-21 12:23:06.789872+00 |
| updated_at | 2023-09-26 16:58:34.135793+00 |
| description | A simple math interpreter |
| homepage | https://www.boon4681.com |
| repository | https://github.com/boon4681/moo-math |
| max_upload_size | |
| id | 979397 |
| size | 24,849 |
_(_)_
'-e e-'
(o_o)
What does the cow sound like?
It's moo~ moo moo
Mathematics interpreter utility, written without dependencies, capable of
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));
}