(b, mantissabits=5, zeroexp=2)
return unpack("f", pack("i", bits))[0]
Decodes a floating point number stored in a single byte.
Decodes a floating point number stored in a single byte.
Decodes a floating point number stored in a single byte .
def byte_to_float(b, mantissabits=5, zeroexp=2):
    """Decodes a floating point number stored in a single byte.
    """
    if type(b) is not int:
        b = ord(b)
    if b == 0:
        return 0.0

    bits = (b & 0xff) << (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 & 0xff ) << ( 24 - mantissabits ) bits += ( 63 - zeroexp ) << 24 return unpack ( "f" , pack ( "i" , bits ) ) [ 0 ]