Comment

Comment by jpopesculian

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/

parent jpopesculian 2 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton