Hi John,
bit shifting is modifying the bits in binary so you are talking about
base2, if you want to preserve the numbers after you combine them ie 12345 is
in base10 then you want to multiply to the power of 10 to shift the whole
number left. You also need to make sure that you have a datatype that is
capable of representing this large number. What you want to do is:
12321
34543
67876
i'd like to end up with
123213454367876
then it is:
123210000000000 + 3454300000 + 67876 = 123213454367876
which you could do by:
int i1 = 12321;
int i2 = 34543;
int i3 = 67876;
double dall = i1 * 1E10 + i2 * 1E5 + i3;
Hope that helps
Mark Dawson
http://www.markdawson.org
"john conwell" wrote:
I have 3 5-digit numbers that i'd like to combine into one 15 digit number,
and later rip back into the original 3 5-digit numbers.
I know i can do this easily with some string manipulations, but i'm pretty
sure i can do the same thing with some bitwise operation like bit shifting or
something.
basically, if i have the following 3 numbesr
12321
34543
67876
i'd like to end up with
123213454367876
any ideas?