primitive-type

Rust i8: 8-bit signed integer

`i8` stores signed whole numbers in 8 bits. Its range is -128 through 127. A small signed adjustment, such as a calibration offset. Expected output: -12 Why: The chosen value is representable by i8. Common mistake: A negative adjustment fits; a value of 128 does not.

Formal Syntax & Structure

rust syntaxrust
let name: i8 = integer_literal;

Working Example

Example Snippetrust
fn main() {    let offset: i8 = -12;    println!("{offset}");}
Rust Reference