Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: Converting negative number to binary with specific widthby pjkang7 (Novice) |
on Nov 05, 2015 at 16:52 UTC ( [id://1147009]=note: print w/replies, xml ) | Need Help?? |
Thanks, I simply did want -1 to show up as 1111111111... of width 10. which, in unsigned int, it would mean infinite (hence lots of ones...) but I just wanted to cut it at ten 1s. I did not know sprintf always print the entire number. Thanks.
In Section
Seekers of Perl Wisdom
|
|