J
junky_fellow
Hi guys,
I have some value stored in an unsigned long integer. My
requirement is to
zero the 13 LSB bits of this number. Or more specifically, I want to
make the number
8k (8192) aligned. For instance, if the value is 26 kilobytes I should
get 24kilobytes.
Can somebody tell me a portable way of doing it. I thought of
using a mask 0xfffe0000, but that won't work if long is 8 bytes long on
some other
machine. I also thought of right shifting the number by 13 bits and
again left shifting it
by 13. But, I don't know if this is a good way of soing it.
Can anyone sugggest me a cleaner way of doing it ?
thanks a lot for any help ...
I have some value stored in an unsigned long integer. My
requirement is to
zero the 13 LSB bits of this number. Or more specifically, I want to
make the number
8k (8192) aligned. For instance, if the value is 26 kilobytes I should
get 24kilobytes.
Can somebody tell me a portable way of doing it. I thought of
using a mask 0xfffe0000, but that won't work if long is 8 bytes long on
some other
machine. I also thought of right shifting the number by 13 bits and
again left shifting it
by 13. But, I don't know if this is a good way of soing it.
Can anyone sugggest me a cleaner way of doing it ?
thanks a lot for any help ...