-
-
Senior Member
In actionscript (and in C), numbers with leading zeros are considered to be in octal (base 8). 8, 9 is not a valid octal digit, so 08 and 09 generate syntax errors.
Check this out:
trace(01);
trace(02);
trace(03);
trace(04);
trace(05);
trace(06);
trace(07);
trace(010); // says 8
trace(011); // says 9
trace(012); // says 10
Incidentally, although this feature has been common in C-based languages since the inception of C, I know of no practical use for octal these days.
I almost always use either decimal (123) or hexidecimal (0xabc).
- jim
-
woah far out man... octal
thanks for that explaination, that was really perplexing me!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|