Does anyone knows how can I count how many digits are there in a binary number? Any ideas???
kiks
0
Newbie Poster
Recommended Answers
Jump to Postcreate a loop that repeatedly divides the value by 10 until its value becomes 0. increment a counter on each loop iteration. see the description for the idiv instruction if you do not know what it does.
Jump to PostYou would need to convert the binary number to an integer first for that though, wouldn't you?
All 8 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
Ryu
0
Newbie Poster
vov4ik
0
Newbie Poster
Ryu
0
Newbie Poster
Purple Avenger
18
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.