Data types
Learn the basic data types in Rust.
One of the most robust features of Rust is its type system. It allows us to catch bugs in compile-time and improve code readability.
Numeric types
Rust has two numeric data types:
- Integer
- Float
Integer
The basic integer data types are described below:
Length | Signed | Unsigned |
---|---|---|
8-bit | i8 |
u8 |
16-bit | i16 |
u16 |
32-bit | i32 |
u32 |
64-bit | i64 |
u64 |
128-bit | i128 |
u128 |
arch | isize |
usize |
A signed integer is a number that ...