on Mar 19th, 2014, 9:04pm, Wendell wrote:i couldnt find anything about a comand to check for Parity of a number |
|
This is the fastest method I know (for 32-bit integers); it returns 0 for even parity and 1 for odd parity:
Code: DEF FNparity(X%)
X% EOR= X% >> 1
X% EOR= X% >> 2
X% EOR= X% >> 4
X% EOR= X% >> 8
X% EOR= X% >> 16
= X% AND 1
Richard.