def byte_to_float(b, mantissabits = 5, zeroexp = 2):
    """Decodes a floating point number stored in a single
    byte.
    """
    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]
dataset/ETHPy150Open dokipen/whoosh/src/whoosh/util.py/byte_to_float/original