rekka / meval-rs

Math expression parser and evaluation library for Rust
The Unlicense
152 stars 30 forks source link

Complex numbers #18

Open abagshaw opened 5 years ago

abagshaw commented 5 years ago

Any plans to support complex numbers?

rekka commented 5 years ago

Thanks for bringing it up. I do not have any plans besides supporting f64/f32 types. My goal for this crate is to be as easy as possible to use, and the (not so well thought out) design has been driven by my use in numerical computations. I am not against it, so I welcome pull requests adding complex numbers support as long as they do not make the library more difficult to use. I am guessing that a simple use of generics and the num-traits crate for trait bounds (Float) might do the trick.

abagshaw commented 5 years ago

Sounds good, yeah complex number support isn't something I need right now but maybe down the road I'll get around to implementing it and open a PR.