Skip to content

Glossary: Coding Interviews in Go

Integer division

Also written: whole-number division

Dividing two `int`s in Go gives a whole number with the decimals dropped, so `n * (n + 1) / 2` stays an integer. Convert with `float64(...)` first when you need decimals.

Where the book teaches it

Related terms

Back-of-the-envelope estimate