The Float attribute has been removed, and now methods are integral type implementations. This means that accessing the math functions requires a little less input:
fn main() { let val: f32 = 3.14159; println!("{}", val.sin()); }
However, this is ambiguous if 3.14159.sin() refers to a 32- or 64-bit number, so you need to specify it explicitly. I set the variable type above, but you can also use a type suffix:
fn main() { println!("{}", 3.14159f64.sin()); }
You can also use the unambiguous syntax for calling a function:
fn main() { println!("{}", f32::sin(3.14159)); }
Shepmaster
source share