Class: Float
Overview
Extensions for Ruby's Float
class.
Instance Method Summary collapse
-
#to_sxp ⇒ String
Returns the SXP representation of this object.
Instance Method Details
#to_sxp ⇒ String
Returns the SXP representation of this object.
108 109 110 111 112 113 114 |
# File 'lib/sxp/writer.rb', line 108 def to_sxp case when nan? then 'nan.' when infinite? then (infinite? > 0 ? '+inf.' : '-inf.') else to_s end end |