In 0.13.0-nightly the following code won't compile:
fn main() {
let a = (10.5f64).sqrt();
}
I get the error:
error: type `f64` does not implement any method in scope named `sqrt`
What am I doing wrong?
In 0.13.0-nightly the following code won't compile:
fn main() {
let a = (10.5f64).sqrt();
}
I get the error:
error: type `f64` does not implement any method in scope named `sqrt`
What am I doing wrong?
sqrt
method is in thestd::num::Float
trait, so you need touse
it:prints
Demo