primitive-type

Rust i64: 64-bit signed integer

`i64` stores signed whole numbers in 64 bits. Its range is -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807. A large signed counter that can exceed i32 capacity. Expected output: -3000000000 Why: The chosen value is representable by i64. Common mistake: A large literal needs a type that can represent it.

Formal Syntax & Structure

rust syntaxrust
let name: i64 = integer_literal;

Working Example

Example Snippetrust
fn main() {    let net_change: i64 = -3000000000;    println!("{net_change}");}
Rust Reference