File: ns_emptynamespace.rs

package info (click to toggle)
rust-fasteval 0.2.4-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 952 kB
  • sloc: python: 14; makefile: 8
file content (10 lines) | stat: -rw-r--r-- 245 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
// usage:  cargo run --release --example ns_emptynamespace

fn main() -> Result<(), fasteval::Error> {
    let mut ns = fasteval::EmptyNamespace;

    let val = fasteval::ez_eval("sin(pi()/2)", &mut ns)?;
    assert_eq!(val, 1.0);

    Ok(())
}