Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Binary Subtraction
02-09-2009, 05:22 PM #1
- Join Date
- Feb 2009
- Thanked 0 Times in 0 Posts
I'm having a problem with binary subtraction. Let me outline this aspect of my program:
Method takes 2 Strings as input, returns a single String, which will be the first string minus the second string. Both strings represent binary numbers.
Both Strings are input in form "101011101", with any leading 0's cut. String can be of ANY length, hence why I have not used more usual constructs. What I'm after is an efficient way of taking one from the other, without converting them to numbers first. This is purely because there are no constructs designed to support a number of any length.
An alternative, and preferable method would be to store the numbers in a format where they can be any length, and can have mathematical operations performed on them still.
Any help would be greatly appreciated.