Crates.io | ios_calculator |
lib.rs | ios_calculator |
version | 0.2.1 |
source | src |
created_at | 2023-04-21 14:00:30.562754 |
updated_at | 2023-04-22 14:28:01.503829 |
description | A simple iOS calculator implementation. |
homepage | |
repository | https://github.com/alexdgourlay/wasm-ios-calc/tree/main/wasm-calculator/ios_calculator |
max_upload_size | |
id | 845321 |
size | 22,700 |
An implementation of the basic iOS calculator featuring:
use ios_calculator::{Calculator, Operator};
let mut calc = Calculator::new();
calc.submit_number(1);
calc.submit_decimal();
calc.submit_number(2);
calc.submit_operator(Operator::add());
calc.submit_number(2);
calc.submit_equals();
assert_eq!(
calc.output().value(),
3.2,
);
assert_eq!(
calc.output().to_string(),
"3.2",
);