def unpack(n)
            sign = n >> 31
            exponent = (n >> (32 - 9)) & 0b11111111
            value = n & 0b11111111111111111111111

            resul = nil
            if 1 <= exponent and exponent <= 254
                result = (-1)**sign * (1 + value * 2**(-23)) * 2**(exponent - 127)
            elsif exponent == 0
                result = (-1)**sign * value * 2**(-23) * 2**(-126)
            else
                # NaN, infinity...
                raise 'Invalid binary'
            end

            result.to_f
        end
def unpack(n)
            sign = n >> 31
            exponent = (n >> (32 - 9)) & 0b11111111
            value = n & 0b11111111111111111111111

            resul = nil
            if 1 <= exponent and exponent <= 254
                result = (-1)**sign * (1 + value * 2**(-23)) * 2**(exponent - 127)
            elsif exponent == 0
                result = (-1)**sign * value * 2**(-23) * 2**(-126)
            else
                # NaN, infinity...
                raise 'Invalid binary'
            end

            result.to_f
        end
Unpacks a number from the EGM file