to_s

cmp.to_s â string
Instance Public methods

Returns the value as a string.

Complex(2).to_s                       #=> "2+0i"
Complex('-8/6').to_s                  #=> "-4/3+0i"
Complex('1/2i').to_s                  #=> "0+1/2i"
Complex(0, Float::INFINITY).to_s      #=> "0+Infinity*i"
Complex(Float::NAN, Float::NAN).to_s  #=> "NaN+NaN*i"
doc_ruby_on_rails
2015-04-01 15:27:28
Comments
Leave a Comment

Please login to continue.