Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Convert Decimal to Binary

 

I need to convert a decimal to binary, and display the binary value. Does anyone know of a way to do this?

 

Thanks, Donna

Posted
There will be loads of algorithms for this on the internet, i remeber i wrote one for my AS Level course when i have about 15. Anyway - yeah.

Phil Price�

Visual Studio .NET 2003 Enterprise Edition

Microsoft Student Partner 2004

Microsoft Redmond, EMEA Intern 2004

  • Leaders
Posted

Well, one way to go about it (if you are still here :( )

Q = 65536
Do
   D2B &= (Decim \ Q)
   Decim -= (Q * (Decim \ Q))
   Q = Q \ 2
Loop While Q > 0

I did something like this in VB6, but should be easily adaptable. :)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...