andyvand / gmpy

Automatically exported from code.google.com/p/gmpy
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Add pack and unpack methods. #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes it is helpful to consider an mpz as a sequence of M n-bit fields. I 
propose to add two methods to pack (unpack) an mpz/xmpz from (to) a length-M 
list consisting of positive number of length n or less.

When packing, an error will be raised if a value in the list is negative or has 
length greater than n. When unpacking, an error will be raised if the initial 
value is negative.

Original issue reported on code.google.com by casevh on 4 Aug 2010 at 1:00

GoogleCodeExporter commented 9 years ago
Completed.

Original comment by casevh on 12 Aug 2010 at 5:34