Evan Teran <eteran at alum.rit.edu> writes: Certain integer values yield incorrect results after "right shift" operations. For example the following program: mpz_tdiv_q_2exp(result, mpz, 32); outputs: $ ./test -49999 -50000 That seems to be the correct output. I think you might want to reread the documentation for mpz_tdiv_q_2exp. -- Torbjörn