ME3Explorer.UnrealHelper.UPropertyReader.getFloat16 C# (CSharp) Method

getFloat16() public method

public getFloat16 ( int pos ) : float
pos int
return float
        public float getFloat16(int pos)
        {
            UInt16 u = BitConverter.ToUInt16(memory, pos);
            int sign = (u >> 15) & 0x00000001;
            int exp = (u >> 10) & 0x0000001F;
            int mant = u & 0x000003FF;
            exp = exp + (127 - 15);
            int i = (sign << 31) | (exp << 23) | (mant << 13);
            byte[] buff = BitConverter.GetBytes(i);
            return BitConverter.ToSingle(buff, 0);
        }