The "first 5 bits" of a number really depend on the storage format.
For example as a 32 bit integer, 129 is represented as 00000000000000000000000010000001, the first 5 bits of which are all zero.
If that's not what you want, consider converting the number to the string 10000001 by using sprintf and then use substr to extract what you want.
In reply to Re: first 5 bits and last 3 bits
by moritz
in thread first 5 bits and last 3 bits
by pashanoid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |