This commit is contained in:
Connor 2018-09-10 12:24:24 -07:00 committed by GitHub
parent 207603e462
commit a904f76704

View File

@ -82,8 +82,10 @@ def encode(string, c0=BETA0, c1=BETA1, adaptive=True):
# if the gap a-b is getting small, rescale it
while a > QUARTER and b < THREEQU:
charstack[0] += 1
a += a - HALF
b += b - HALF
a *= 2
b *= 2
a -= HALF
b -= HALF
assert a <= HALF
assert b >= HALF