Class: Float
- Defined in:
- vendor/bundler/ruby/3.2.0/bundler/gems/sxp.rb-c250c287c809/lib/sxp/extensions.rb
Overview
Extensions for Ruby's Float
class.
Instance Method Summary collapse
-
#to_sxp(**options) ⇒ String
Returns the SXP representation of this object.
Instance Method Details
#to_sxp(**options) ⇒ String
Returns the SXP representation of this object.
133 134 135 136 137 138 139 |
# File 'vendor/bundler/ruby/3.2.0/bundler/gems/sxp.rb-c250c287c809/lib/sxp/extensions.rb', line 133 def to_sxp(**) case when nan? then 'nan.0' when infinite? then (infinite? > 0 ? '+inf.0' : '-inf.0') else to_s end end |