import struct


def get_double(bindata):
    """Get double value (8 byte)."""
    v = struct.unpack('BBBBBBBB', bindata)
    e = v[0]
    rh = v[1] << 24 | v[2] << 16 | v[3] << 8 | v[4]
    rl = v[5] << 24 | v[6] << 16 | v[7] << 8
    s = -1 if (rh & 0x80000000) != 0 else 1
    if e == 0:
        return 0.0
    e -= 128
    d = (rh | 0x80000000) * pow(2.0, e - 32)
    d += rl * pow(2.0, e - 32 - 24)
    return s * d