Parma Polyhedra Library requirements
C++ unbounded integer divisors and square roots
1. Exact unbounded integer greatest common divisor and least common multiple PPL-SPEC-000517

For live mpz_class sources with entry values a and b, gcd_assign_r shall assign their nonnegative greatest common divisor g. Two zero sources shall yield zero; when exactly one source is zero, g shall be the other source's absolute value. lcm_assign_r shall assign zero when either source is zero, otherwise shall assign the positive integer |a ⁄ g| |b|.

Both operations shall return V_EQ for every valid rounding request, including strict and exactness requests. The output may alias either source and both sources may be the same object; the formula shall use their entry values. Distinct sources shall remain unchanged. Unbounded resource, object-synchronization and initialization/hardware independence conditions shall follow 🔗 1. Exact named arithmetic on unbounded integer storage. No configured bounded-coefficient range shall limit either operation.

2. Exact unbounded integer Bezout coefficients PPL-SPEC-000518

For live mpz_class sources with entry values a and b, gcdext_assign_r shall assign the nonnegative greatest common divisor to g and integers to s and t satisfying as + bt = g. For two zero sources, g shall be zero; no particular pair of Bezout coefficients shall be required. No unique pair shall be prescribed in other cases either.

The three output objects shall be pairwise distinct and distinct from both source objects. The source objects may be the same object. The operation shall return V_EQ for every valid rounding request, including strict and exactness requests, and preserve both sources. Available resources shall suffice for the unbounded outputs and intermediates. Synchronization, initialization independence and absence of configured coefficient/FPU limits shall follow 🔗 1. Exact named arithmetic on unbounded integer storage.

PPL-SPEC-000519
3. Directed unbounded integer square roots PPL-SPEC-000519

For a live nonnegative mpz_class source with value a, let r = √(a) denote the exact nonnegative real root. sqrt_assign_r with ROUND_DOWN shall assign ⌊r⌋ and with ROUND_UP shall assign ⌈r⌉. A perfect-square source shall return V_EQ for either direction. Otherwise, downward rounding shall return V_GT and upward rounding shall return V_LT. Adding ROUND_STRICT_RELATION shall retain these definite classifications.

ROUND_IGNORE shall select the floor and return a relation admitting r ≥ to. A strict delegated request shall distinguish V_EQ from V_GT. ROUND_NOT_NEEDED shall require a to be a perfect square, assign the exact root and return a relation admitting equality; a strict exactness request shall return V_EQ. The result shall never depend on irrational_precision.

The destination may alias the source, using its entry value. A distinct source shall remain unchanged. Resource, range, synchronization and initialization/hardware independence conditions shall follow 🔗 1. Exact named arithmetic on unbounded integer storage. Shared scratch-integer pools used for directed root remainders shall be serialized in a build without thread-safe support; thread-safe configurations shall use calling-thread pools.