Mar 28, 2003 #1 D DonnaF Active member Joined Mar 20, 2003 Messages 30 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
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
Mar 29, 2003 #2 P philprice Well-known member Joined Mar 21, 2003 Messages 116 Location Hull, UK 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.
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.
Mar 30, 2003 #3 Iceplug Well-known member Joined Aug 20, 2001 Messages 706 Location South Carolina, USA Well, one way to go about it (if you are still here ) Code: 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.
Well, one way to go about it (if you are still here ) Code: 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.
Mar 30, 2003 #4 V Volte Neutiquam Erro Joined Nov 17, 2002 Messages 2,165 User Rank *Expert* Code: Convert.ToString(<value>, 2) Thatll return the binary.