Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Using the Standard library

  • std

  • f32

  • f64

  • consts

  • PI

  • std

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