. .

st4u

ST 4U 295: Large and Small Integers in Smalltalk

October 12, 2012 11:30:43.184

Today's Smalltalk 4 You looks at integer math in Smalltalk - noting that you don't ever need to worry (outside of database issues, of course) about the small/large integer divide. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Integer Math.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Today we'll look at how integer math works in Smalltalk - specifically, the fact that you don't ever need to worry about "big ints". As a simple example, let's calculate a small factorial 10.

Small Integer

Now let's try something big, and add a small number to it:


1000 factorial + 1

Display the result gives you a LargeInteger object - demonstrating that you simply do not need to worry about this level of "type" information in Smalltalk - it's handled for you:

LargeInteger

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Technorati Tags: , ,

Enclosures:
[st4u295-iPhone.m4v ( Size: 2095904 )]

posted by James Robertson

 Share Tweet This