Back: SingletonProxy-saving and restoring Up: Base classes Forward: SmallInteger class-getting limits   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.148 SmallInteger

Defined in namespace Smalltalk
Superclass: Integer
Category: Language-Data types
I am the integer class of the GNU Smalltalk system. My instances can represent signed 30 bit integers and are as efficient as possible.

1.148.1 SmallInteger class: getting limits  (class)
1.148.2 SmallInteger class: testing  (class)
1.148.3 SmallInteger: bit arithmetic  (instance)
1.148.4 SmallInteger: built ins  (instance)
1.148.5 SmallInteger: builtins  (instance)
1.148.6 SmallInteger: coercion  (instance)
1.148.7 SmallInteger: coercion methods  (instance)
1.148.8 SmallInteger: testing functionality  (instance)


1.148.1 SmallInteger class: getting limits

bits
Answer the number of bits (excluding the sign) that can be represented directly in an object pointer

largest
Answer the largest integer represented directly in an object pointer

smallest
Answer the smallest integer represented directly in an object pointer


1.148.2 SmallInteger class: testing

isIdentity
Answer whether x = y implies x == y for instances of the receiver


1.148.3 SmallInteger: bit arithmetic

highBit
Return the index of the highest order 1 bit of the receiver

lowBit
Return the index of the lowest order 1 bit of the receiver.


1.148.4 SmallInteger: built ins

* arg
Multiply the receiver and arg and answer another Number

+ arg
Sum the receiver and arg and answer another Number

- arg
Subtract arg from the receiver and answer another Number

/ arg
Divide the receiver by arg and answer another Integer or Fraction

// arg
Dividing receiver by arg (with truncation towards -infinity) and answer the result

< arg
Answer whether the receiver is less than arg

<= arg
Answer whether the receiver is less than or equal to arg

= arg
Answer whether the receiver is equal to arg

== arg
Answer whether the receiver is the same object as arg

> arg
Answer whether the receiver is greater than arg

>= arg
Answer whether the receiver is greater than or equal to arg

\\ arg
Calculate the remainder of dividing receiver by arg (with truncation towards -infinity) and answer it

asFloatD
Convert the receiver to a FloatD, answer the result

asFloatE
Convert the receiver to a FloatE, answer the result

asFloatQ
Convert the receiver to a FloatQ, answer the result

asObject
Answer the object whose index is in the receiver, nil if there is a free object, fail if index is out of bounds

asObjectNoFail
Answer the object whose index is in the receiver, or nil if no object is found at that index

bitAnd: arg
Do a bitwise AND between the receiver and arg, answer the result

bitOr: arg
Do a bitwise OR between the receiver and arg, answer the result

bitShift: arg
Shift the receiver by arg places to the left if arg > 0, by arg places to the right if arg < 0, answer another Number

bitXor: arg
Do a bitwise XOR between the receiver and arg, answer the result

divExact: arg
Dividing receiver by arg assuming that the remainder is zero, and answer the result

nextValidOop
Answer the index of the first non-free OOP after the receiver. This is used internally; it is placed here to avoid polluting Object.

quo: arg
Dividing receiver by arg (with truncation towards zero) and answer the result

~= arg
Answer whether the receiver is not equal to arg

~~ arg
Answer whether the receiver is not the same object as arg


1.148.5 SmallInteger: builtins

at: anIndex
Answer the index-th indexed instance variable of the receiver. This method always fails.

at: anIndex put: value
Store value in the index-th indexed instance variable of the receiver This method always fails.

basicAt: anIndex
Answer the index-th indexed instance variable of the receiver. This method always fails.

basicAt: anIndex put: value
Store value in the index-th indexed instance variable of the receiver This method always fails.

scramble
Answer the receiver with its bits mixed and matched.


1.148.6 SmallInteger: coercion

asCNumber
Convert the receiver to a kind of number that is understood by the C call-out mechanism.


1.148.7 SmallInteger: coercion methods

generality
Return the receiver's generality

unity
Coerce 1 to the receiver's class

zero
Coerce 0 to the receiver's class


1.148.8 SmallInteger: testing functionality

isSmallInteger
Answer `true'.



Back: SmallInteger-coercion methods Up: SmallInteger Forward: SortedCollection   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on May, 22 2008 using texi2html