Alex Vinokur wrote:

"Karl Heinz Buchegger" <kb******@gascad.at> wrote in message news:41***************@gascad.at... Alex Vinokur wrote:

Dann Corbit has implemented function

int ilog2 (unsigned long)

at http://groups.google.com/groups?selm....1498%40client

Is exist a similar C++-function for very large numbers, e.g., function with signature

vector<unsigned long> ilog2 (const vector<unsigned long>&)?

No.

Mostly because vector<unsigned long> is *not* a very large number

but an array of numbers, nothing more.

I am using vector<unsigned long> to build class BigInt

at http://groups.google.com/groups?selm....uni-berlin.de

operator+() has been defined for BigInt.

Now I would like to define operator/() as well.

operator/() seems to require using ilog2().

???

Not really.

You could do it with logarithms and power functions.

But it definitily is not necessary.

(I don't think that kids at an age of 9 use logarithms

to do divisions :-)

I don't think it is a shame to download one of the many

available BigInt libraries, study the source code, analyze

it, figure out how they do it and then adopt what you have learned

to your own class.

--

Karl Heinz Buchegger

kb******@gascad.at