x = 0
x = 1
x = 2
x = 3
x = 4
x = 5
x = 6
x = 7
x = 8
x = 9
x = 10
x = 11
x = 12
x = 13
x = 14
x = 15
x = 16
x = 17
x = 18
x = 19
x = 110
x = 111
x = 112
x = 113
x = 114
x = 115
x = 116
x = 117
x = 118
x = 119
x = 1110
now x = 1110
inlinebool integer::operator ++()
{
if (POS)
{
bool r = number[memory-1].p1();
if (r)
returntrue;
else
{
VERY BIG i = memory - 2, sp = i - size;
for (; i > sp; --i)
{
number[i+1] = 0;
resize(size+1);
r = number[memory-size].p1();
if (r)
returntrue;
}
}
returnfalse;
}
returnfalse;
}
inlinebool integer::operator ++(){
if (POS){
//Increment least significant digit.
bool r = number[memory-1].p1();
if (r) //Has the LS digit looped around?
returntrue;
else{
//Yes.
//Start from the back, skip the final element.
VERY BIG i = memory - 2, sp = i - size;
for (; i > sp; --i){
//On the first iteration, zero the last element.
number[i+1] = 0;
//Resize the number.
//Logic error: not all numbers that fit these conditions should
//be resized. Examples:
// 19 -> 20
// 390 -> 400
resize(size+1);
//I belive this says "increment the most significant digit".
//Logic error: the MS digit shouldn't have to be incremented
//more than once for each number increment.
r = number[memory-size].p1();
//Logic error: this condition will never be false. The loop
//never runs more than once.
if (r)
returntrue;
}
}
returnfalse;
}
returnfalse;
}
Thanks, but does anyone remember the threat from a while back, I think it may have been in the lounce, where they were doing a group project or something on an big num class? I think it would help me immensly for ideas, now that I' ve been workin on my own for a while anyways.