Skip to content

Instantly share code, notes, and snippets.

@Kerollmops
Last active January 5, 2017 10:16
Show Gist options
  • Select an option

  • Save Kerollmops/9f635cf707e53d05c5d86b63266d7f36 to your computer and use it in GitHub Desktop.

Select an option

Save Kerollmops/9f635cf707e53d05c5d86b63266d7f36 to your computer and use it in GitHub Desktop.
basic example float for the Medium article on Ripin-rs
extern crate ripin;
use ripin::operate::FloatExpression;
let str_expr = "3 4 + 2 *";
let tokens = str_expr.split_whitespace();
let expr = FloatExpression::<f32>::from_iter(tokens).expect("Parsing error!");
assert_eq!(expr.evaluate(), Ok(14.0));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment