Better integer performance possible?

agree at carltonfields.com agree at carltonfields.com
Mon Oct 25 20:34:32 UTC 1999


> SmallIntegers aren't easily
> understandable... all of the complexity
> is hidden into C into machine-language into silicon.  There > is absolutly
> no insight on how to
> divide small integers anywhere (that I know of) in Squeak.

I dissent.  Read the Source Code!  SmallInteger arithmetic, particularly division is quite well-documented.  Start by examining the methods themselves.  SmallInteger>>//, for example:

\\ aNumber 	"Primitive. Take the receiver modulo the argument. The result is the
	remainder rounded towards negative infinity, of the receiver divided by
	the argument Fail if the argument is 0 or is not a SmallInteger. Optional.
	No Lookup. See Object documentation whatIsAPrimitive."

And of course, if you prod around, you will find SmallInteger class has a category, entitled "documentation", containing the method "guideToDivision."  Finally, anyone who really needs to know the gory details (not so many) need only look at Interpreter, in category "arithmetic primitives."





More information about the Squeak-dev mailing list