newtonmath
newtonmath
is a Rust wrapper for the Newton API, a really micro micro-service for advanced math.
Functions implemented:
fn simplify(exp: &str) -> DataResult fn factor(exp: &str) -> DataResult fn derive(exp: &str) -> DataResult fn integrate(exp: &str) -> DataResult fn find_zeroes(exp: &str) -> DataResult fn find_tangent(exp: &str) -> DataResult fn area_under_curve(exp: &str) -> DataResult fn cosine(exp: &str) -> DataResult fn sine(exp: &str) -> DataResult fn tangent(exp: &str) -> DataResult fn inverse_cosine(exp: &str) -> DataResult fn inverse_sine(exp: &str) -> DataResult fn inverse_tangent(exp: &str) -> DataResult fn absolute_value(exp: &str) -> DataResult fn logarithm(exp: &str) -> DataResult
The DataResult
returnedis of type Result<String, reqwest::Error>
.
Setup
- Add
newtonmath
as a dependency in your Cargo.toml
[dependencies]
newtonmath = "0.2.0"
extern crate newtonmath as newton;
Usage
fn main(){
let res = newton::derive("x^2-1");
match res {
Ok(data) => println!("{}", data), Err(err) => println!("{:?}",err) };
}