Mar 28, 2003 #1 D DonnaF Freshman 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 Centurion 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 I Iceplug Contributor Joined Aug 20, 2001 Messages 709 Location California, USA Well, one way to go about it (if you are still here ) Visual Basic: 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 ) Visual Basic: 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,172 Visual Basic: Convert.ToString(<value>, 2) That'll return the binary.