I want to create a simple calculator using Visual Basic.Net 2003. The Scope of my Project is to perform a simple number system like to convert a dicimal value to binary, octal, hexadecimal and vice versa. My Problem is the code of decimal to binary, Decimal to hexadecimal. I hope you can help me!!
1 Replies - 11764 Views - Last Post: 22 March 2007 - 10:08 PM
#1
How do I convert the Decimal number in Binary number in VB.NET
Posted 19 March 2007 - 11:18 PM
Replies To: How do I convert the Decimal number in Binary number in VB.NET
#2
Re: How do I convert the Decimal number in Binary number in VB.NET
Posted 22 March 2007 - 10:08 PM
For decimal to binary conversion, think about how it works. So first you want to find the highest value base 2 that can go into the number you are trying to convert, without going over the that number, so that will be a 1, then subtract that from the original number. Then start moving down (decrementing) the exponent if it goes into it then it's a 1 and then subtract that from the value and find the next one, and if it doesn't go into it then it is represented as a 0.
So try it out and just come up with an algorithm for it, it shouldn't be too hard, and it will be similar for finding it in octal, and hexidecimal.
So try it out and just come up with an algorithm for it, it shouldn't be too hard, and it will be similar for finding it in octal, and hexidecimal.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|