(lo, hi uint32)
| 10 | func NewEncoder() *Encoder { return &Encoder{lo: 0, hi: ^uint32(0)} } |
| 11 | |
| 12 | func (p P) midpoint32(lo, hi uint32) uint32 { |
| 13 | return lo + uint32(uint64(hi-lo)*uint64(p)>>probBits) |
| 14 | } |
| 15 | |
| 16 | func (enc *Encoder) Encode(bit uint, prob P) { |
| 17 | x := prob.midpoint32(enc.lo, enc.hi) |