def _vax_to_ieee_single_float(data):
    """Converts a float in Vax format to IEEE format.

    Data should be a single string of chars that have been read in from
    a binary file. These will be processed 4 at a time into float values.
    Thus the total number of byte/chars in the string should be divisible
    by 4.

    Notes
    -----
    Based on VAX data organization in a byte file, we need to do a bunch of
    bitwise operations to separate out the numbers that correspond to the
    sign, the exponent and the fraction portions of this floating point
    number

    role :      S        EEEEEEEE      FFFFFFF      FFFFFFFF      FFFFFFFF
    bits :      1        2      9      10                               32
    bytes :     byte2           byte1               byte4         byte3

    Returns
    -------
    f : array
        Contains floats in IEEE format

    """
    f = []
    nfloat = int(len(data) / 4)
    for i in range(nfloat):
        byte2 = data[0 + i * 4]
        byte1 = data[1 + i * 4]
        byte4 = data[2 + i * 4]
        byte3 = data[3 + i * 4]
        sign = (byte1 & 128) >> 7
        expon = ((byte1 & 127) << 1) + ((byte2 & 128) >> 7)
        fract = ((byte2 & 127) << 16) + (byte3 << 8) + byte4
        if sign == 0:
            sign_mult = 1.0
        else:
            sign_mult = -1.0
        if 0 < expon:
            val = sign_mult * (0.5 + fract / 16777216.0) * pow(2.0, expon -
                128.0)
            f.append(val)
        elif expon == 0 and sign == 0:
            f.append(0)
        else:
            f.append(0)
    return f
