From: JZ Date: 2005-07-15T19:35:52+09:00 Subject: Re: to_i() bug? Dnia Fri, 15 Jul 2005 19:11:43 +0900, ts napisa�(a): >> why result is 1 instead of 0? > > moulon% ruby -e 'p "1A01".to_i(2); p "10B01".to_i(2)' > 1 > 2 I found, Ruby assumes that it will extract all characters up to first impossible character. Is seems to be wrong assumption. to_i should return 0 or exception for all impossible conversions. -- JZ