Arithmetic leaves stray zero limbs at the top of a result, and a zero can be written many ways. Today you define the one canonical form - no leading zero limbs - so every magnitude has exactly one representation.
Strip high-order zero limbs so equal magnitudes always have identical limb arrays.
An addition or a subtraction can leave a zero in the top limb - 1000000000 minus 999999999 is just 1, but the machinery might hand you the limbs (1, 0). If we
let that stand, two equal numbers could have different limb arrays and comparison
would break. Normalizing fixes this: walk down from the most significant limb
and drop every zero until you hit a non-zero one (or run out).
The important special case is zero itself, which we represent as the empty magnitude - zero limbs. That gives zero exactly one form and, once we add a sign next lesson, is what stops a “negative zero” from ever existing. From here on, treat “normalized” as an invariant: every magnitude a public operation returns has no leading zero limbs.
// drop trailing (most-significant) zero limbsfunc (m mag) normalize() mag {i := len(m)for i > 0 && m[i-1] == 0 { i-- }return m[:i]}// zero is the empty slice: NumLimbs 0