If I run the following code, the first two lines return what I expect. The third, however, returns a binary representation of 2.
2.to_s # => "2"
2.to_s * 2 # => "22"
2.to_s *2 # => "10"
I know that passing in 2 when calling to_s
will convert my output to binary, but why is to_s
ignoring the *
in the third case? I'm running Ruby 1.9.2 if that makes any difference.