This commit is contained in:
parent
207603e462
commit
a904f76704
1 changed files with 4 additions and 2 deletions
|
@ -82,8 +82,10 @@ def encode(string, c0=BETA0, c1=BETA1, adaptive=True):
|
||||||
# if the gap a-b is getting small, rescale it
|
# if the gap a-b is getting small, rescale it
|
||||||
while a > QUARTER and b < THREEQU:
|
while a > QUARTER and b < THREEQU:
|
||||||
charstack[0] += 1
|
charstack[0] += 1
|
||||||
a += a - HALF
|
a *= 2
|
||||||
b += b - HALF
|
b *= 2
|
||||||
|
a -= HALF
|
||||||
|
b -= HALF
|
||||||
|
|
||||||
assert a <= HALF
|
assert a <= HALF
|
||||||
assert b >= HALF
|
assert b >= HALF
|
||||||
|
|
Loading…
Reference in a new issue