You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn main() {
let x: f64 = 2.0;
println!("{}", x / 2);
}
Returns:
expected `f64` but found `<generic integer #0>` (expected f64 but found integral variable)
Easy fix is to change the 2 to a 2.0, although that seems kind of excessive in this case. It makes more sense to make integer constants generic numbers, like Haskell does, if they're going to be generic.