mpz_class unpredictable behavior

Hande Kara handekarai.hk at gmail.com
Sun Apr 19 19:10:01 UTC 2020


Hi ,

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.


 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <https://gmplib.org/list-archives/gmp-discuss/attachments/20200419/042adac2/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: application/octet-stream
Size: 307 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-discuss/attachments/20200419/042adac2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Matrix.h
Type: application/octet-stream
Size: 861 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-discuss/attachments/20200419/042adac2/attachment-0001.obj>


More information about the gmp-discuss mailing list