you can try to do something like this:
but as you noted bits are bytes anyways, so maybe you can just use a if < 0.5 or something.
if < 0.5