• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

The Number Data Type

The next data type we'll discuss is the Number data type. Numbers come in all sorts of forms and are used for lots of different reasons, ranging from counting, to mathematical properties of movie clips, to expressions. Let's look at a few examples:

1                  //legal number
4.998              //legal number
3+4                //legal number
_x                 //legal number representing a horizontal position
string.length      //legal number representing the length of a string
0123               //legal number representing an octal number
10e2               //legal number using exponents
0x000000           //legal hexadecimal number
"1234"             //not a legal number, but a string literal


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint