Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Converting negative number to binary with specific width

by pjkang7 (Novice)
on Nov 05, 2015 at 16:52 UTC ( [id://1147009]=note: print w/replies, xml ) Need Help??


in reply to Re: Converting negative number to binary with specific width
in thread Converting negative number to binary with specific width

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.

  • Comment on Re^2: Converting negative number to binary with specific width

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1147009]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-18 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found