Method: StringIO#float

Defined in:
lib/core_ext/stringio.rb

#floatFloat

Reads a floating-point integer (32 bit) from the current position of the byte stream

Returns:

  • (Float)

    The floating-point integer read from the byte stream



35
36
37
# File 'lib/core_ext/stringio.rb', line 35

def float
  read(4).unpack('e')[0]
end