Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
puts ((11.to_s * 2).to_i/2), does anyone know answer of this coding? I am not aware of ruby!
I just learned enough ruby to do this
ruby -e "puts ((11.to_s * 2).to_i/2)"
which doesn't help much
ruby -e "puts (11.to_s * 2)"
So it appears to convert 11 to a string (.to_s) then doubles it then converts the answer back to an integer (.to_i) and then divides it by 2.