opal/corelib/marshal/read_buffer.rb
# Reads and returns Float from an input stream
#
# @example
#   123.456
# Is encoded as
#   'f', '123.456'
#
Reads and returns Float from an input stream
Reads and returns Float from an input stream
def read_float
      s = read_string(cache: false)
      result = if s == 'nan'
                 0.0 / 0
               elsif s == 'inf'
                 1.0 / 0
               elsif s == '-inf'
                 -1.0 / 0
               else
                 s.to_f
               end
      @object_cache << result
      result
    end
def read_float s = read_string ( cache : false ) result = if s == 'nan' 0.0 / 0 elsif s == 'inf' 1.0 / 0 elsif s == '-inf' - 1.0 / 0 else s . to_f end @object_cache << result result end
Reads and returns Float from an input stream
Reads and returns Float from an input stream
example
None