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 (2024). Parity (https://www.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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0