>

  1. Bitwise Operations and Manipulations in AS3

    Bitwise Operation Machine
    On the path of beeing the As3 world master scripter there is something important to know about number manipulation.
    Even if we are normally dealing with the as3 Number type such uint, int and Number as normal object (java type wrapper like), we can take advance on how the integer number are rappresented and handle by the flash player.

    The base concept, as “Bitwise” may suggest, is to use the bit representation of the number.
    A number can be represented in an infinite number of ways. The representation we are used to is called decimal, or base 10.
    The binary, or base 2, number system is the one that computers use to represent numbers in memory. Since we’re dealing with base 2, there are only two digits available, namely 0 and 1. Each digit is multiplied by successive powers of two to obtain the number’s overall value.

    Following some of the useful/interesting implementation of the art of handle bit.

    (more…)

  2. Number in AS3

    Dice Cube
    As programmers we are used to deal with numbers every day.
    We feel good with math, since there are no shading, and any assertion can be only true or false.
    What we usually don’t know is that computers make errors. They do it lots of time, even on basic calculation,where every an human usually dosn’t. Knowing this will let us handling the sad problem.

    Even if ActionScript 3 offers us only 3 basic data Types (int, uint and Number) that is , compared with other Languages really a small number, we still suffer the same problem, since is not a language problem, but simply how computers rappresents numbers.

    (more…)