Functions for producing human-readable outputs for elements. Converting elements to and from bytes are discussed later.
size_t element_out_str(FILE *stream,int base,element_t e)-
Output
eonstreamin basebase. The base must be between 2 and 36. int element_printf(const char *format,...)int element_fprintf(FILE *stream,const char *format,...)int element_snprintf (char *buf,size_t size,const char *fmt,...)-
Same as printf family except also has the 'B' conversion specifier for types of
element_t, and 'Y', 'Z' conversion specifiers for mpz_t. For example ifeis of type element_t thenelement_printf("%B\n", e);will print the value of
ein a human-readable form on standard output. int element_snprint(char *s,size_t n,element_t e)-
Convert an element to a human-friendly string. Behaves as
snprintfbut only on one element at a time. int element_set_str(element_t e,char *s,int base)-
Set the element
efroms, a null-terminated C string in base 'base'. Whitespace is ignored. Points have the form "[x,y]" or "O", while polynomials have the form "[a0,...,an]". Returns number of characters read (unlike GMP's mpz_set_str). A return code of zero means PBC could not find a well-formed string describing an element.