foresta / single-digit-rpn

A RPN (Reverse Polish Notation) with Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Single digit Reverse Polish Notation

Build Status

This package is a single digit RPN calculator. Only single digit RPN is supported:

123++ => 1 + (2 + 3)
4 5 3 - * => 4 * (5 - 3)
7 8*9- => 7 * 8 - 9

Usage

extern crate single_digit_rpn;
use single_digit_rpn::rpn;

let result: f64 = rpn("123++").unwrap();
assert_eq!(result, 6.0);

Examples

You can find example code in the examples directory.

To execute it, do the folloing:

cargo run --example cli

About

A RPN (Reverse Polish Notation) with Rust

License:MIT License


Languages

Language:Rust 100.0%