I use GF field elements to represent positive as well as negative integers, and 
in some situations I want to convert the field elements to integers, e.g. to 
display them to a user.

I have implemented two methods signed() and unsigned() which returns a signed 
or a unsigned representation of a GF field element. They are implemented as 
methods in the GFElement class because it maintains the encapsulation of the 
prime used as a modulo. E.g. a user of GF fields needs not propagate the prime 
to the code for user interaction, but only needs the prime when the GF field is 
instantiated.
_______________________________________________
viff-patches mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-patches-viff.dk

Reply via email to