* 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 LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |