Parity

Version 1.0.0 (1.42 KB) by DJ Schott
Calculates the binary parity for an un-signed integer
17 Downloads
Updated 4 Jun 2020

View License

* calculates the binary parity for an un-signed integer
* based on the algorithm of Cedric Wannaz
(https://de.mathworks.com/matlabcentral/answers/65419-check-parity-of-a-uint32-without-converting-to-a-binary-string#answer_76952)
* modified on 2020-06-04 by D. J. Schott for University of Freiburg
* added modulo and input checking
* x: input is cast to uint64
* y: output is either 1(odd), 0(even)

Cite As

DJ Schott (2026). Parity (https://uk.mathworks.com/matlabcentral/fileexchange/76577-parity), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2020a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0