Skip to content

Instantly share code, notes, and snippets.

@henryobiaraije
Created May 19, 2023 20:48
Show Gist options
  • Save henryobiaraije/f5e57524f3880b16f59bb93a8f0db2f0 to your computer and use it in GitHub Desktop.
Save henryobiaraije/f5e57524f3880b16f59bb93a8f0db2f0 to your computer and use it in GitHub Desktop.
How to use the Calculator Crate
// Full video tutorial here https://www.youtube.com/watch?v=LJppDNH2CHI
use calculator::Calculator;
fn main(){
let mut calculator = Calculator::new();
calculator
.add([4.0,10.0,20.0].to_vec())
.subsctract([100.0].to_vec());
println!("result is {}",calculator.get_result());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment