Get n-bit parity. 📰 📘
Similar: count, parity.
parity x n -- x: an Int -- n: number of bits (1)
import Bit exposing (..) parity 7 1 -- 1 (1,1,1 ⇒ 1) parity 5 1 -- 0 (1,0,1 ⇒ 0) parity 8 2 -- 2 (10,00 ⇒ 10) parity 63 4 -- 12 (11,1111 ⇒ 1100)
There was an error while loading. Please reload this page.