3 ms·
Why hex though?
by alex_young 3y ago
Why hex though?
- graypegg 3y ago2 hex characters represent 1 byte (8bits) so it lines up nicely if you’re looking at where memory gets saved, and will align nicely with big rollovers since it’s a power of 2 radix. FFFFFFFE => FFFFFFFF => 00000000, rather than 4294967294 => 4294967295 => 0 or the equivalent formatted as a date string. Feels better for a count down thing. Plus bonus points for, when mentioning how 64 bit ints are the solution here: FF FF FF FF (u32) = 00 00 00 00 FF FF FF FF (u64) makes it pretty clear what the trade off in memory usage is vs range gained.