ios_calculator

Crates.ioios_calculator
lib.rsios_calculator
version0.2.1
sourcesrc
created_at2023-04-21 14:00:30.562754
updated_at2023-04-22 14:28:01.503829
descriptionA simple iOS calculator implementation.
homepage
repositoryhttps://github.com/alexdgourlay/wasm-ios-calc/tree/main/wasm-calculator/ios_calculator
max_upload_size
id845321
size22,700
Alex Gourlay (alexdgourlay)

documentation

README

Rusty iOS Calculator

An implementation of the basic iOS calculator featuring:

  • DMAS (division, muliplication, addition, subtraction) operations
  • Decimalisation
  • Memory of last calculation
  • Percentage conversion

Example

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",
); 
Commit count: 0

cargo fmt