Using the Standard library
-
std
-
f32
-
f64
-
consts
-
PI
fn main() {
println!("{}", std::f32::consts::PI);
println!("{}", std::f64::consts::PI);
// println!("{}", PI); // error[E0425]: cannot find value `PI` in this scope
}
3.1415927
3.141592653589793