query: nearest integer divide
Mon, 24 Mar 2003 10:18:13 -0000
I have an application where I have a large mpz_t x, and a long p,
and I want to compute the nearest integer y to x/2^p. It seems I have
two obvious ways:
2. or, compute the quotient and remainder (this seems to need separate
calls in gmp with the 2exp functions), and check the size of the remainder
compared to the divisor.
Does anybody have any knowledge about which method is faster, or perhaps
an idea for another method?
Dr. Keith M. Briggs
Senior Mathematician, Complexity Research, BTexact Technologies