primitive-type

Rust u64: 64-bit unsigned integer

`u64` stores nonnegative whole numbers in 64 bits. Its range is 0 through 18,446,744,073,709,551,615. A large nonnegative byte count. Expected output: 5000000000 Why: The chosen value is representable by u64. Common mistake: A u64 value is not automatically a valid array index.

Formal Syntax & Structure

rust syntaxrust
let name: u64 = integer_literal;

Working Example

Example Snippetrust
fn main() {    let bytes: u64 = 5000000000;    println!("{bytes}");}
Rust Reference