-
[F8] Defining a Numbers bit length??
Hey guys & girls,
I was wondering if it was possible in F8 to define a Numbers bit length..for example: I might want a number to go up to a maximum hex value 0xFF, which is a total of 8 bits "11111111", but if I was to increment the value it would become "100000000", I was wondering whether the Number could stay at a length of 8 bits thus resetting it to 0x00. It doesn't appear that this is possible without using the '&' operator but it would be faster for something i'm testing out!
Any ideas?? Cheers
-
Senior Member
You could just "watch" that value, then when set if the number is greater than 2^8 or whatever, return 0. Or else return value.
-
Script kiddie
Originally Posted by RipX
Hey guys & girls
On Flash Kit?
...
Where?
-
Heli Attack!
I think you solved your own puzzle, theres no way I know to specifically limit the size of Number. uint and int are a bit smaller in AS3, but apart from that, just & your number with binary 1111 to keep your number at 4 bits etc.
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
|