I am trying to create what is essentially a u24 (three byte integer).
I don't need it to have all the functionality of the built-in integers, just a few things:
It must be exactly three bytes (hard requirement) and support basic addition, subtraction, and multiplication, all with options for both checked and wrapping behavior.
I have it working using a struct with three fields of type u8. It has a size of 3 but my math functions all require converting into u32 to perform arithmetic. Is there a better way? Also, is my naive struct guaranteed to have the same size on all platforms, or do I need to do something else to help ensure that is true?