14.9: Chapter Summary

Deep into Pharo · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-SA 3.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    14.9: Chapter Summary

    Pharo uses 2’s complement encoding for its internal small integer representation and supports bit manipulation of their internal representation. This is useful when we want to speed up algorithms using simple encoding. We have reviewed the following points:

    • Numerical values use complement to encode their negative value.
    • Shifting a bit to the left multiple is equivalent to multiply it by 2, modulo the maximum value of its encoding size.
    • On the opposite, shifting a bit to the right divides it by 2.
    • Bits operations can be performed on any numerical values.
    • Complement are useful to turn an addition into a subtraction, thus simplifying the operation.
    • SmallInteger are coded on 31 bits on Pharo.

    Note that Pharo supports large numbers whose limit in size is mainly the memory you have at your disposal.


    This page titled 14.9: Chapter Summary was last modified on Mon, 26 Jul 2021 15:16:43 GMT and is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Alexandre Bergel, Damien Cassou, Stéphane Ducasse, Jannik Laval (Square Bracket Associates) via source content that was edited to the style and standards of the LibreTexts platform.