---
title: "Chapter 4: Fundamental Data Types"
description: "The 12 lessons of chapter 4: Fundamental Data Types, in teaching order."
url: "https://learnrust.net/chapter-4/"
last_updated: "2026-06-11"
---

# Chapter 4: Fundamental Data Types

- [4.1 Introduction to fundamental data types](https://learnrust.net/chapter-4/introduction-to-fundamental-data-types.md): Bits, bytes, and what a type actually is: how Rust decides what the bits in memory mean.
- [4.2 Integer types](https://learnrust.net/chapter-4/integer-types.md): Rust's ten integer types, their exact ranges, signed versus unsigned, and why mixing them is a compile error rather than a bug.
- [4.3 isize, usize, and integer literals](https://learnrust.net/chapter-4/isize-usize-and-integer-literals.md): Rust's pointer-sized integers, where usize shows up, and the full integer literal syntax: suffixes, underscores, hex, octal, and binary.
- [4.4 Integer overflow](https://learnrust.net/chapter-4/integer-overflow.md): What happens when Rust arithmetic exceeds a type's range: debug panics, release wrapping, and the checked, wrapping, and saturating alternatives.
- [4.5 Floating-point types](https://learnrust.net/chapter-4/floating-point-types.md): Rust's f32 and f64: scientific notation, precision limits, rounding error, infinity, and NaN.
- [4.6 Boolean values](https://learnrust.net/chapter-4/boolean-values.md): Rust's bool type: true, false, the ! operator, and why there's no truthiness.
- [4.7 Introduction to if expressions](https://learnrust.net/chapter-4/introduction-to-if-expressions.md): Rust's if: bool-only conditions, mandatory braces, else chains, and the twist that if produces a value.
- [4.8 char and a first look at Unicode](https://learnrust.net/chapter-4/char-and-unicode.md): Rust's char type: four bytes, Unicode scalar values, single versus double quotes, and why '5' is not 5.
- [4.9 Type inference and annotations](https://learnrust.net/chapter-4/type-inference-and-annotations.md): How Rust infers types from values and usage, the i32 and f64 defaults, and the rare cases where it needs your help.
- [4.10 Numeric conversions with as](https://learnrust.net/chapter-4/numeric-conversions.md): Explicit casts in Rust: widening, truncation, float-to-int saturation, and why every conversion is your signature on a form.
- [4.11 Tuples and the unit type](https://learnrust.net/chapter-4/tuples-and-the-unit-type.md): Grouping values with tuples, destructuring, returning multiple values from functions, and the truth about ().
- [4.x Chapter 4 summary and quiz](https://learnrust.net/chapter-4/chapter-4-summary-and-quiz.md): Every type and term from Chapter 4, plus a calculator program and the famous falling-ball exercise.

## Sitemap

See the full [sitemap](https://learnrust.net/sitemap.md) for all pages.
