Atelier des rouesLab FR
Objects/Documentation

largeurs29.py

Two other word weights and byte padding · largeurs29.py

Download ↓
"""Check the byte-padding period for two additional constant-weight word formats."""
from math import comb
from periodes28 import summary,join,repeat
import json
def study(weights=(3,6)):
    out=[]
    for k in weights:
        width=(comb(32,k)-1).bit_length();runs=None;bands=[]
        for bits in range(1,18):
            start=1<<(bits-1);length=min(65537,2*start)-start
            def gap(n):
                pad=(-1-13*((n+63)//64)-width*n)%8
                return (2*bits-1-pad+7)//8-(bits+6)//7
            def sign(x):return (x>0)-(x<0)
            pat=[sign(gap(n)) for n in range(start,start+min(512,length))]
            count,tail=divmod(length,512)

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.