more useful options | |
PerlMonks |
Re^7: How to assign a variable its width/vectorby soonix (Canon) |
on Apr 15, 2014 at 09:29 UTC ( [id://1082326]=note: print w/replies, xml ) | Need Help?? |
You seem to need the size (or length) neither in chars nor in bytes, but in bits. I think you can take the dec2bin from How do I convert between decimal and binary? Then, length dec2bin 0x100 (or length(dec2bin(0x100))) gives you a result of 9. Alternatively, to see if an address fits in 32 bits, you could compare it to 0xffffffff, which is the biggest value to fit.
In Section
Seekers of Perl Wisdom
|
|