mpz_class unpredictable behavior

Marc Glisse marc.glisse at inria.fr
Sun Apr 19 20:15:37 UTC 2020


On Sun, 19 Apr 2020, Hande Kara wrote:

> I am using C++ newly. There was an issue when I was trying to addition operator overloading.
> Result object must be equal this [0 1 1 0] [(0 1 1 0)(2423 575 0 0)(466 3465664 0 0)] [2423 575 0 0] according to my implementation. ( You can think my illustration like this [this][x][y])
> When first time in operator overloading this (0 1 1 0)(2423 575 0 0)(466 3465664 0 0) occurs, which is right.
> But, when operator overloading is called second time, inside result like [0 1 1 0] [(0 1 0 0)(2423 575 0 0)(466 3465664 0 0)] [2423 575 0 0].
> So, result->x->c is wrong , it must be 1 but it becomes 0. Why is this happening? What is wrong I did not understand. Could you help me? Thanks.

Hello,

I am sorry, we'd love to help you, but we don't have time to debug other 
people's code. Maybe you could try stackoverflow.com or some similar site? 
If you find some suspicious behavior in GMP, that you can demonstrate with 
less surrounding code and clear instructions to reproduce it, please do 
come back and post it here, thanks.

-- 
Marc Glisse


More information about the gmp-discuss mailing list