I\'m looking for the most efficient way to calculate the minimum number of bytes needed to store an integer without losing precision.
e.g. int: 10 = 1 byte
A bit basic, but since there will be a limited number of outputs, can you not pre-compute the breakpoints and use a case statement? No need for calculations at run-time, only a limited number of comparisons.