Parma Polyhedra Library requirements
C++ finite native floating-point unary operations and ordering
1. Finite native floating-point floor, ceiling and truncation PPL-SPEC-000325

The source and destination shall have admitted raw or checked types in 🔗 1. Native floating-point NaN and infinity predicates with the same native storage format F. The source shall be finite, with exact represented value a. floor_assign_r shall assign ⌊a⌋; ceil_assign_r shall assign ⌈a⌉; and trunc_assign_r shall assign trunc(a) toward zero. Each result shall be exactly representable in F and shall return V_EQ for all four base directions in 🔗 4. Rounding-direction intent, composition and inspection, with or without the strict-relation flag. This exact relation shall describe the specified integer-valued function, even when its value differs from the source. When a result is zero, it shall have the source's sign.

A nonintegral source shall require the current hardware rounding direction to be upward. An integral source shall require no particular current hardware direction. Calls shall preserve that direction. A source may be the destination itself or designate its raw storage; the result shall be computed from the source's entry value. Source and destination may also share storage through a checked object's raw-value reference. A source with distinct storage shall remain unchanged. The destination shall be live and assignable. Object synchronization, availability, initialization independence and nontrapping floating-point conditions shall follow 🔗 1. Native floating-point NaN and infinity predicates. The _r interfaces shall return the result without policy-handler dispatch.

2. Exact finite native floating-point negation and absolute value PPL-SPEC-000326

For the same-format admitted raw or checked source/destination types in 🔗 1. Finite native floating-point floor, ceiling and truncation and a finite source with represented value a, neg_assign_r shall assign  − a and abs_assign_r shall assign |a|. Both shall return V_EQ under all four base directions, with or without ROUND_STRICT_RELATION. Negation shall reverse a zero's sign. Absolute value shall produce positive zero for either signed zero. All finite extrema and subnormals shall retain their exact magnitudes, independent of the configured global coefficient range.

No particular current hardware rounding direction shall be required, and calls shall preserve that direction. Destination validity, source aliases, source preservation, synchronization, availability, initialization independence and floating-point exception conditions shall follow 🔗 1. Finite native floating-point floor, ceiling and truncation. The _r interfaces shall return their result without policy-handler dispatch.

PPL-SPEC-000327
3. Sign of a finite native floating-point value PPL-SPEC-000327

For an admitted raw or checked source type in 🔗 1. Native floating-point NaN and infinity predicates whose represented value a is finite, sgn(x) shall return  − 1 when a < 0, zero when a = 0 and 1 when a > 0. Both signed zeros shall return zero. A negative subnormal shall remain negative and a positive subnormal positive.

Source validity, preservation, synchronization, availability, initialization independence and floating-point state conditions shall follow 🔗 1. Native floating-point NaN and infinity predicates. The result shall require no arithmetic in the configured coefficient type and shall be independent of hardware direction.

4. Ordered comparison of finite native floating-point values PPL-SPEC-000328

For admitted raw or checked operand types in 🔗 1. Native floating-point NaN and infinity predicates with the same native storage format and finite represented values a and b, cmp(x, y) shall return a negative integer exactly when a < b, zero exactly when a = b and a positive integer exactly when a > b.

equal, not_equal, less_than, less_or_equal, greater_than and greater_or_equal shall return the truth values of a = b, a ≠ b, a < b, a ≤ b, a > b and a ≥ b, respectively. The corresponding PPL operators ==, !=, <, <=, > and >= shall return those same truth values when at least one operand is checked. Oppositely signed zeros shall compare equal. The operands may designate the same object or raw storage.

Both operand objects shall remain unchanged. Source validity, synchronization, availability, initialization independence and floating-point state conditions shall follow 🔗 1. Native floating-point NaN and infinity predicates. Comparison shall require no bounded coefficient intermediate and no particular hardware rounding direction, and shall preserve that direction.