You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 30, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 30, 2021. It is now read-only.
The current _rand_exp is currently looking suboptimal:
# Exp2 generates n with probability 1/2^(n+1). @staticmethoddef_rand_exp():
rand_bin=bin(int(random.random() *2**32-1))[2:]
rand_bin='0'*(32-len(rand_bin)) +rand_bincount=0foriinrand_bin:
ifi=='0':
count+=1else:
breakreturncount
Am I misreading the code and the comment, or is it equivalent to int(random.expovariate(0.5))?
_rand_exp generates a number from 0-32 I'm don't see how it's equivalent to int(random.expovariate(0.5)) but maybe I'm missing something. I also searched a better way to implement this when I ported this part from go-fuzz but didn't find anything "built-in"
Activity
yevgenypats commentedon Dec 18, 2019
_rand_expgenerates a number from 0-32 I'm don't see how it's equivalent toint(random.expovariate(0.5))but maybe I'm missing something. I also searched a better way to implement this when I ported this part from go-fuzz but didn't find anything "built-in"jvoisin commentedon Dec 18, 2019
Then the comment above the function should be fixed/improved I think :)