On 12 Jul 2008, at 09:39, Wouter Smeenk wrote:
>
> Only after the second test it begins to catchup. This also has allot
> of extra parentheses so expect better result! :)
>
Yup, I shaved some off mine:
symbolify(9999).length == 37
symbolify(999999).length == 48
symbolify(12345678901234567890).length == 266
symbolify
(1234567899999999999999999999999999999999999901234567890).length == 645
symbolify(('9'*2100).to_i).length == 25295
(0..10000).to_a.inject(0) {|a, i| a + symbolify(i).length} == 396700

feeling like diminishing returns at this point


> I wrote some simple testcode that might be useful:
>
> [
> "symbolify(9999).length",
> "symbolify(999999).length",
> "symbolify(12345678901234567890).length",
> "symbolify
> (1234567899999999999999999999999999999999999901234567890).length",
> "symbolify(('9'*2100).to_i).length",
> "(0..10000).to_a.inject(0) {|a, i| a + symbolify(i).length}"
> ].each do |test|
>  print test + " == "
>  $stdout.flush
>  puts (eval test).to_s
> end
>
> Wouter
>