batteries
batteries copied to clipboard
feat: add `Nat.Digits`
This PR adds functions for calculating digit representation in any base. Both little-endian and big-endian versions are provided.
You might want to consider that #799 ought to be compatible with this. I am sure there's a lemma like this in Mathlib somewhere but I can't find it.
(Mathlib has Nat.bits, which modulo finTwoEquiv is the same as this.)
Good reminders! This PR is on hiatus until I find time to rethink the overall design.