Fabian Giesen on Nostr: npub1hyy7v…wlp3g FWIW this is in turn actually related to how decimal (BCD) ...
npub1hyy7vkgpdt2we5c5t94delpu3cylgexlnvsal6jcz5v3xjkkn7qswwlp3g (npub1hyy…lp3g) FWIW this is in turn actually related to how decimal (BCD) arithmetic units (where present, e.g. for IBMs decimal FP) are implemented internally.
E.g. for mult, you precompe 2x (binary shift within a decimal digit), 10x (decimal shift across decimal digits) and 5x (decimal shift left then binary halving of resulting digits), and then summing {-1,0,1} multiples of them, e.g.:
1x = x
2x = 2x
3x = 2x + x
4x = 5x - x
5x = 5x
6x = 5x + x
7x = 5x + 2x
8x = 10x - 2x
9x = 10x - x
E.g. for mult, you precompe 2x (binary shift within a decimal digit), 10x (decimal shift across decimal digits) and 5x (decimal shift left then binary halving of resulting digits), and then summing {-1,0,1} multiples of them, e.g.:
1x = x
2x = 2x
3x = 2x + x
4x = 5x - x
5x = 5x
6x = 5x + x
7x = 5x + 2x
8x = 10x - 2x
9x = 10x - x