<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt">I am trying to understand the behavior of mzp_export. The following code snippet displays the resulting exported array. If I start with 0 and increment, I get the arrays I would expect: [0x0 0x0...] [0x1 0x0...] [0x2 0x0...]. If I decrement from 0 I get: [0x0 0x0...] [0x1 0x0...], i.e., the identical arrays!<br>Can anyone shed light on what's going on?<br>Thanks, Bob<br><br>int main(void)<br> {<br> mpz_class x;<br> x = "0x0";<br> unsigned char result[ArraySize];<br> memset ( result, 0, ArraySize );<br> for (int j = 0; j < 5ArraySize j++ )<br> {<br> mpz_export
(result,<br> NULL, // number of words produced<br> 1, // order<br> 1, // word size<br> 0, // use native endianness<br> 0, // "nails" - produce full
"words"<br> x.get_mpz_t()<br> );<br> cout << "---------------------------" << endl;<br> for (int i = 0; i < ArraySize; i++)<br> {<br> cout << "result[" << i << "] = " << hex << (int)result[i] << endl;<br> }<br> x -= 1;<br> }<br> return 0;<br> }<br><div> </div><font style="color: rgb(127, 0, 63);" size="3"><span
style="font-style: italic;"><br></span></font></div><br>
</body></html>