When subdividing intervals for arithmetic coding, the worst case scenario is that the final interval will have size 2^(1-n), where n is the number of unique symbols you are encoding. This will reach the limits of machine precision, when using regular datatypes, really quickly: For instance, I've made a JavaScript implementation and it breaks after encoding around just 15 characters!As this is pretty limiting, how do codecs get around this?Encode [very] short blocks, within the machine's limits, and concatenate them together? That will add overhead.Use non-native types with arbitrary precision? This will be slow.Something else?...
Arithmetic Coding vs. Machine Numeric Precision
coding;compression;numeric precision;arithmetic
According to Wikipedia:Rather than try to simulate infinite precision, most arithmetic coders  instead operate at a fixed limit of precision which they know the  decoder will be able to match, and round the calculated fractions to  their nearest equivalents at that precision. [...] A process called renormalization keeps the finite precision from  becoming a limit on the total number of symbols that can be encoded.  Whenever the range is reduced to the point where all values in the  range share certain beginning digits, those digits are sent to the  output. For however many digits of precision the computer can handle,  it is now handling fewer than that, so the existing digits are shifted  left, and at the right, new digits are added to expand the range as  widely as possible.