Skip to content
Subhajit Sahu edited this page Jan 24, 2021 · 5 revisions

Set a bit. 📰 📘

Alternatives: set, setAs.
Similar: get, set, toggle.


set x i f
-- x: an Int
-- i: bit index
-- f: bit value (1)
import Bit exposing (..)

set 6 0 1
-- 7 (110,0,1 ⇒ 111)

set 6 2 1
-- 6 (110,2,1 ⇒ 110)

set 6 2 0
-- 2 (110,2,0 ⇒ 010)


References

Clone this wiki locally