Here's a short summary of what I'm trying to do: I'm trying to defragment this integer - 210110131 into four integers: 2, 1011, 013, and 1. Here are my calculations:
For the first int I just run a 'bigger than or equals' check because the long integer is always smaller than 3*10^8 (the first digit is always 1 or 2).
For the three other ints, A, B and C, I run the following:
a = (longint - 200000000)/10000;
b = ((longint - 200000000) - (a*10000))/10;
c = ((longint - 200000000) - (a*10000)) - (b*10);
The problem is that the cog retrieves only A (it prints to screen 1011) but leaves B and C assigned with zero, instead of B = 13 and C = 1.
Is something wrong with the way I handle the integers?
[This message has been edited by Fardreamer (edited February 05, 2001).]
For the first int I just run a 'bigger than or equals' check because the long integer is always smaller than 3*10^8 (the first digit is always 1 or 2).
For the three other ints, A, B and C, I run the following:
a = (longint - 200000000)/10000;
b = ((longint - 200000000) - (a*10000))/10;
c = ((longint - 200000000) - (a*10000)) - (b*10);
The problem is that the cog retrieves only A (it prints to screen 1011) but leaves B and C assigned with zero, instead of B = 13 and C = 1.
Is something wrong with the way I handle the integers?
[This message has been edited by Fardreamer (edited February 05, 2001).]
Dreams of a dreamer from afar to a fardreamer.