I would agree with bob but basically when you take a look at source
code of that then i figured out that if * is not passed even then it
would behave in the same way.
this would still give 1
but there is some wierd thing going on with to_i
when you say "3".to_i(10) outputs 3 with base 10 which is as expected
if you say "3".to_i(2) outputs 0 rather than binary representation of
3. any idea??
str.to_i(base) says to interpret 'str' as a representation of a number
in base 'base'. Since "3" doesn't contain any valid base 2 digits
[0,1], the value is 0 (just like with "hello".to_i)
You're looking at Numeric#to_s and String#to_i