If you encode a signed number or an unsigned number, the reliable
region will be the same (0<=x<2^(bits-1)). You need to know if it's
stored unsigned or signed when you decode, but not when you encode,
unless you want to throw an error for numbers that don't fit.

Compare to casting in C - cast -17 to (unsigned). It's not going to be
0, you just told the compiler that it was actually an unsigned stored
there.
  • pos... H. William Welliver III
    • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
      • ... Bill Welliver
        • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
          • ... Bill Welliver
            • ... Mirar @ Pike developers forum
              • ... Bill Welliver
                • ... Mirar @ Pike developers forum
                • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
                • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
        • ... Mirar @ Pike developers forum
          • ... Bill Welliver
            • ... Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
              • ... Bill Welliver
                • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
                • ... Mirar @ Pike developers forum
                • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
    • ... Mirar @ Pike developers forum

Reply via email to