Sorry to resurrect the thread, but I just thought this should be said:
Code:
for (int i = 0; i < BIGINTSIZE; ++i) {
data[i] += q.data[i] + carry;
if (!carry) {
carry = (data[i] < q.data[i]) ? 1U : 0U;
} else {
carry = (data[i] <= q.data[i]) ? 1U : 0U;
}
}
Note that you could use this instead, because of what Dave_Sinkula posted:
Code:
for (int i = 0; i < BIGINTSIZE; ++i) {
data[i] += q.data[i] + carry;
if (!carry) {
carry = data[i] < q.data[i];
} else {
carry = data[i] <= q.data[i];
}
}
Not my arena either, but it seems like you might be right:
(From
http://en.wikipedia.org/wiki/Instruction_pipeline.)
I'm assuming that flushing a pipeline is a bad thing . . . :)