There's an easy optimisation that can be made when printing Nat objects in base-16 (or indeed, any base that is exactly convertible from Nat::BASE –this is guaranteed to be a power of 2 that is a multiple of 8 (i.e. $2^{8n}$ for $n\in\mathbb{N}$):
Just print each digit in this base, in order. No base-conversion needed.
There's an easy optimisation that can be made when printing
Nat
objects in base-16 (or indeed, any base that is exactly convertible fromNat::BASE
–this is guaranteed to be a power of 2 that is a multiple of 8 (i.e. $2^{8n}$ for $n\in\mathbb{N}$):Just print each digit in this base, in order. No base-conversion needed.