I have a problem where I get two bytes represented as an int from 0-255, two bytes are supposed to represent one value. Right now I am doing it like this, but it takes way to a long time. Any tips?
bin_string = '0b' + bin(int(second_byte))[2:].zfill(8) + bin(int(first_byte))[2:].zfill(8)
result = float(literal_eval(bin_string))
example:
203 -> 11001011
101 -> 01100101
-> 1100101101100101 -> 52069
I feel like there could be a simple mathematical formula but I cannot seem to figure it out ...