From: "Collins, Justin" Date: 2006-09-30T08:57:08+09:00 Subject: Re: "1".to_i *2 == 1 && "1".to_i*2 == 2 ? ------_=_NextPart_001_01C6E422.F79F5F02 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Giovanni Intini wrote: > Can anyone explain to me why > > "1".to_i*2 is equal to 2 > and > "1".to_i *2 is equale to 1? > > Thanks > Giovanni > It seems to be interpreting "1".to_i *2 as "1".to_i(*2) or "1".to_i(2) which is 1. Remember the * in function calls is the unarray operator. = Kinda weird in this case, though. -Justin ------_=_NextPart_001_01C6E422.F79F5F02--