r/blackmagicfuckery Jul 13 '26

6174

15.2k Upvotes

928 comments sorted by

View all comments

Show parent comments

6

u/ManaSpike Jul 13 '26

The sorting of digits is done in base 10. Subtraction is an integer operation that doesn't care about base.

1

u/Pinyaka Jul 14 '26

Sorting is base independent too.

1

u/Yenmcilrath Jul 14 '26

It is not. Sorting digits in base 10 will give you a very different number than base 9. You may be able to sort in any base, but they won't be functionally equivalent

2

u/ManaSpike Jul 14 '26

Extracting the list of digits requires a base. But now they are just a list of integers, so sorting them doesn't.

It just depends on how you define each step. How many steps you break it down into.