EDIT: I rebased my bignum class to use std::bitset
and I just implemented long division fine. I just didn't know any class to store bits. (like std::bitset
)
I'm making a bignum class with std::string
to use decimal characters as internal representation. I tried implementing division with a simple algorithm:
while N ≥ D do
N := N - D
end
return N
And of course it was slow. I tried implementing long division but that was too hard to do with decimal characters.
Thanks in advance.