Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Your top-ten linux desktop apps


Bruce Badger wrote:

On 9/29/05, Andrew Bennetts <andrew-slug@xxxxxxxxxxxx> wrote:
Python can be nicer than that:

   integer_array = [1, -2, 3, -4, 5, -6, -7, 8, -9, 32727000]

   for index, value in enumerate(integer_array):
       print "integer [%d] = %d" % (index, value)

So can Smalltalk! :-)

integerArray :=  #(1 -2 3 -4 5 -6 -7 8 -9 32727000 9876543210).

On my Computer which is a 32-bit,  my C compiler is able to handle Integer
size 4 bytes = 32 bits. So 2 exponent 32 less 1 is 2147483647. This is the max
that my computer can handle. Can't handle your number  9876543210.

With C on 64-bit your number will not be a problem as an integer. C integer
is size 8 bytes = 64 bits. So 2 exponent 64 less 1 can be handled.

Is your computer 64-bit or does smalltalk handles wider size integers ?


integerArray doWithIndex: [:element :index|
	Transcript show: 'integer [', index printString, '] = ', element
printString; cr]

(can you other guys handle the big number I added at the end OK?)

Of course, beauty is in the eye of the beholder.

All the best,
     Bruce
--
Make the most of your skills - with OpenSkills
http://www.openskills.org/


--
O Plameras
http://www.acay.com.au/~oscarp/tutor