3 ms·
The nice thing about turns is that they can be represented by an unsigned integer. For example with an 8 bit unsigned integer: - 0000_0000 = 0 or tau - 1000_0
by jpopesculian 2mo ago
The nice thing about turns is that they can be represented by an unsigned integer. For example with an 8 bit unsigned integer:
- 0000_0000 = 0 or tau
- 1000_0000 = pi
- 1100_0000 = 3*pi/4
And the addition and multiplication by integer scalars all apply and the overflows work naturally. I wrote a little library in rust [0] to help with this as you can define the operations */+-% etc.
[0] https://docs.rs/turns/latest/turns/ https://docs.rs/turns/latest/turns/
- srean 2mo agoOoh! that overflow is so clever. I would have been proud to have thought of that. Perfect fit for modular arithmetic.