def byte_to_float(b, mantissabits=5, zeroexp=2):
 if (type(b) is not int):
  b = ord(b)
 if (b == 0):
  return 0.0
 bits = ((b & 255) << (24 - mantissabits))
 bits += ((63 - zeroexp) << 24)
 return unpack('f', pack('i', bits))[0]

def byte_to_float ( b , mantissabits = 5 , zeroexp = 2 ) : if ( type ( b ) is not int ) : b = ord ( b ) if ( b == 0 ) : return 0.0 bits = ( ( b & 255 ) << ( 24 - mantissabits ) ) bits += ( ( 63 - zeroexp ) << 24 ) return unpack ( 'f' , pack ( 'i' , bits ) ) [ 0 ]
decodes a floating point number stored in a single byte .