Extract class for BCMath-based number theory