- Rust Programming By Example
- Guillaume Gomez Antoni Boucher
- 105字
- 2021-07-02 19:12:56
Integer types
The following integer types are available in Rust:

The u means unsigned, while the i means signed, and the number following it is the number of bits. For instance, a number of the u8 type can be between 0 and 255, inclusive. And a number of the i16 type can be between -32768 and 32767, inclusive. The size variants are the pointer-sized integer types: usize and isize are 64-bit on a 64-bit CPU. The default integer type is i32, which means that this type will be used by the type inference when it cannot choose a more specific type.