Numbers
summary
Rob Pike's quip that "numbers are just numbers" means Go treats numeric literals as untyped constant literals so 1<<32 or 10_000_000_000 never silently overflow like in C where 1<<32 can be undefined and 2.1 billion wraps or signed/unsigned promotion turns -1 into a huge value. Go either accepts the literal for the target type or produces a compile-time error. The compiler keeps literals with a 512-bit internal representation so the same source runs everywhere, even on an 8-bit Arduino via TinyGo.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:08Go lacks unsigned literals
- 13:51Computing word sizes history
- 14:11Literal constants complexity
- 16:21BCPL and C’s types
- 19:49Word to byte addressing
- 21:14C’s integer types history
- 23:01Undefined behavior in C
- 27:10C’s integer literal problems
- 29:16Go’s numeric constants solution
- 33:11Go’s numeric constants work
- 34:12Least surprise in Go
- 34:39Q&A








