MCPcopy Create free account
hub / github.com/egonelbre/exp / adapt

Method adapt

coder/arith/models.go:18–25  ·  view source on GitHub ↗
(bit uint)

Source from the content-addressed store, hash-verified

16func (m *Shift) NBits() uint { return 1 }
17
18func (m *Shift) adapt(bit uint) {
19 switch bit {
20 case 1:
21 m.P += (MaxP - m.P) >> m.I
22 case 0:
23 m.P -= m.P >> m.I
24 }
25}
26
27func (m *Shift) Encode(enc *Encoder, bit uint) {
28 enc.Encode(bit, m.P)

Callers 2

EncodeMethod · 0.95
DecodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected