[#1551] Hashes as keys — "Nathaniel Talbott" <nathaniel@...>

I was just playing around with Hash#hash and discovered that you can't use a

13 messages 2003/09/23

why does it take so long?

From: Mathieu Bouchard <matju@...>
Date: 2003-09-11 00:03:46 UTC
List: ruby-core #1527
time ruby -e '(3**40000)'
user    0m0.200s

time ruby -e '(3**40000).zz'
-e:1: undefined method `zz' for #<Bignum:0x804c3a8> (NoMethodError)
user    0m1.610s

this is quite strange. any explanations?

a hint may be:

time ruby -e '(3**40000).to_s'
user    0m1.600s

but then, if raising an exception calls to_s on that, the result of it is
certainly not used (it's 19085 digits)

ruby -v
ruby 1.8.0 (2003-08-31) [i686-linux]

(the problems are similar with 1.6.7, the other version i happen to have
installed)

________________________________________________________________
Mathieu Bouchard                       http://artengine.ca/matju


In This Thread

Prev Next