single-digit-rpn

Crates.iosingle-digit-rpn
lib.rssingle-digit-rpn
version0.1.0
sourcesrc
created_at2020-06-14 12:37:27.542894
updated_at2020-06-14 12:37:27.542894
descriptionCalculate single digit Reverse Polish Notation
homepage
repositoryhttps://github.com/foresta/single-digit-rpn
max_upload_size
id253836
size13,681
kz_morita (foresta)

documentation

README

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
Commit count: 18

cargo fmt