Only works for finite algebraic structures. Effect on polynomial rings, fields of characteristic zero, etc. undefined.
See the chapter on randomness functions on where PBC gets random bits from and how to select a different source of random bits.
void element_random(element_t e)-
If the
elies in a finite algebraic structure, this function assigns a uniformly random element toe.