Skip to content

Glossary: Rust in Practice

integer overflow

Also written: overflow, checked_mul

A number growing past what its type can hold, such as multiplying `u32` cents above about $66,000 by a tax rate. Doing the middle step in a wider type like `u64` avoids it, and `checked_mul` returns `None` instead of overflowing.

Where the book teaches it