internal Golomb(int divisor) { if (divisor < 2) { throw new ArgumentOutOfRangeException(); } this.divisor = divisor; remainderCode = Codes.TruncatedBinary(divisor); var r = remainderCode.MaxEncodable; maxEncodable = divisor * (63 - remainderCode.GetCode(r).Length) + r; }
internal BaseN(int n) { this.n = n; if (Bits.IsPowerOf2(n)) { encoding = Codes.FixedWidth(Bits.FloorLog2(n) + 1); } else { encoding = Codes.TruncatedBinary(n); } }
public void TruncatedBinaryTest() { EncodingTest(Codes.TruncatedBinary(6000)); }