Stoned Elipot wrote: > ... > I expected 'Integer("zzzzzzzzz")' to raise an exception and > was surprised to get a 0 without exception. > > I'm waiting for the compilation of matz's little patch which will surely > fix this... > > Thanks for you quick answers, and fix! I was wrong in saying to_i ignores leading/following garbage. it only ignores garbage after the number. ruby> "5zz".to_i 5 ruby> "zz5".to_i 0 So maybe that makes sense of why we'd want Integer("zzz") to return 0. I'd thought it was supposed to be the way it is. But given that, then the following looks wrong to me - is it correct behavior, and if not, is it perhaps caused by the same bug? ruby> Integer("0xff") 255 ruby> Integer("0xff ") ERROR: (eval):1:in `Integer': invalid literal for Integer: 0xff