Skip to content

Instantly share code, notes, and snippets.

@sayrer
Created February 1, 2022 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayrer/4bdb2e20ad8b49911c396ffe90492981 to your computer and use it in GitHub Desktop.
Save sayrer/4bdb2e20ad8b49911c396ffe90492981 to your computer and use it in GitHub Desktop.
number conversion
fn main() {
let x = 1; // integer
let y = 1f32; // float32
let z = x as f64 + y as f64; // float64
println!("Hello, world: {}", z);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment