PageRenderTime 19ms CodeModel.GetById 17ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/dvbt/trunk/debug/subblocks/csee_old/intxxbin.py

http://github.com/zaqwes8811/decoder-reed-solomon
Python | 9 lines | 8 code | 0 blank | 1 comment | 0 complexity | f2fd75243840037d52be2effeca2990f MD5 | raw file
1def int2bin(n):
2    '''convert denary integer n to binary string bStr'''
3    bStr = ''
4    if n < 0:  raise ValueError, "must be positive"
5    if n == 0: return '0'
6    while n > 0:
7        bStr = str(n % 2) + bStr
8        n = n >> 1
9    return bStr