|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
The parity homomorphism mod_2: int → bool.
More...
Public Types | |
| using | Domain = int |
| using | Codomain = bool |
Public Member Functions | |
| constexpr bool | operator() (int x) const noexcept |
The parity homomorphism mod_2: int → bool.
Uses x % 2 rather than x & 1: the representation-independent parity test matches the textbook reading "remainder mod 2" exactly, and is well-defined for negative x on every C++ implementation (the tests exercise negative inputs).