Skip to content

Instantly share code, notes, and snippets.

@matthewjberger
Last active July 21, 2023 05:33
Show Gist options
  • Save matthewjberger/688a7a95aafac70939d074705c464518 to your computer and use it in GitHub Desktop.
Save matthewjberger/688a7a95aafac70939d074705c464518 to your computer and use it in GitHub Desktop.
Order of Operations example in rust
fn main() {
let (a, b, c) = (1_i32, 2_i32, 3_f32);
let first_result = (a - b) as f32 / c * 1000.0;
let second_result = (a - b) as f32 / (c * 1000.0);
assert_eq!(first_result, second_result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment