Laws for shared IEEE exception flags #
These results quantify over every flag state and selected group. They are independent of number format, numerical value, rounding direction, and runtime storage.
Two flag states are equal when every exception has the same state.
Constructing a flag group preserves its membership predicate.
The default flag state has no exceptions raised.
A singleton selects precisely its named exception.
The all-flags group selects every exception.
A flag in a union is raised exactly when either input raises it.
Accumulating exceptions is associative, so operation grouping does not affect flags.
Flag accumulation is independent of the order in which the same exceptions are raised.
Raising an already raised flag changes nothing.
An operation with no exceptions preserves the accumulated flags.
Existing flags remain raised when another operation contributes exceptions.
A newly raised exception appears in the accumulated state.
Raising a group affects exactly its members.
Clearing a group removes precisely the selected flags.
A saved-state test has the same existential meaning as a current-state test.
Restoration chooses saved state inside the group and current state outside it.
Clearing all exceptions resets the state.
Restoring the complete saved group recovers the snapshot exactly.
An empty selection never reports an exception.
An empty selection leaves all flags unchanged when clearing.
An empty selection leaves all flags unchanged when restoring.