class Float

Extensions for Ruby's `Float` class.

Public Instance Methods

to_sxp() click to toggle source

Returns the SXP representation of this object.

@return [String]

# File lib/sxp/writer.rb, line 107
def to_sxp
  case
    when nan? then 'nan.0'
    when infinite? then (infinite? > 0 ? '+inf.0' : '-inf.0')
    else to_s
  end
end