3 ms·
If I’m looking for the 3rd position in decimal I ignore everything above and below the third position. Which you can do by taking modulo 1000 and dividing by 10
by hinkley 2y ago
If I’m looking for the 3rd position in decimal I ignore everything above and below the third position. Which you can do by taking modulo 1000 and dividing by 100, or dividing by 100 and taking modulo 10, which is easier to calculate in the moment. You don’t need any fixed point math just normal integer floor on division operations.
So why would it be different in ternary?
- Spoof7726 2y agoBecause division is not trivial. Even computing x mod 3 for an n-bit integer x is O(n), if x is represented in the binary form.