Parma Polyhedra Library requirements
C++ finite native operations with powers of two
1. Finite native addition and subtraction of a power of two PPL-SPEC-000504

The source and destination shall have the admitted same-format native or Checked_Number<F, Check_Overflow_Policy<F>> types in 🔗 4. Rounding, result classes and state for finite native binary arithmetic. The source shall be finite with represented value a. The exponent e shall be less than CHAR_BIT * sizeof(unsigned long long), and 2e shall be exactly representable and finite in F.

add_2exp_assign_r shall compute a + 2e and sub_2exp_assign_r shall compute a − 2e. They shall assign the corresponding rounded value and return the result class/relation in 🔗 4. Rounding, result classes and state for finite native binary arithmetic. The power-of-two operand shall introduce no intermediate conversion error. Zero-result signs shall follow the addition/subtraction rules in 🔗 1. Finite native floating-point addition and subtraction with a positive second operand 2e.

Source/destination aliases, source preservation, object validity, synchronization, direction and exactness prerequisites, native backend setup, initialization independence and floating-point exception conditions shall follow 🔗 4. Rounding, result classes and state for finite native binary arithmetic. Neither the source value nor the exponent shall be converted through the configured coefficient type.

PPL-SPEC-000505
2. Finite native multiplication and division by a power of two PPL-SPEC-000505

For the source/destination types, finite source value a and exponent preconditions in 🔗 1. Finite native addition and subtraction of a power of two, mul_2exp_assign_r shall compute a2e and div_2exp_assign_r shall compute a ⁄ 2e. They shall assign the rounded value and return the result class/relation in 🔗 4. Rounding, result classes and state for finite native binary arithmetic. The positive power-of-two operand shall be exact and nonzero. A zero result, including one caused by underflow, shall retain the source sign.

A power-of-two scale shall not promise exactness when exponent-range or subnormal precision limits require approximation. Exponent zero shall preserve the represented source value; its status precision shall still follow the native binary arithmetic protocol. Source aliases, source preservation, object validity, synchronization, direction and exactness prerequisites, native backend setup, initialization independence and floating-point exception conditions shall follow 🔗 4. Rounding, result classes and state for finite native binary arithmetic. No bounded coefficient intermediate shall limit the native format's value range.