Extract class for GMP-based number theory