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

Get bits as per mask. 📰 📘

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


getAs x m
-- x: an Int
-- m: bit mask
import Bit exposing (..)

getAs 6 4
-- 4 (110,100 ⇒ 100)

getAs 6 7
-- 6 (110,111 ⇒ 110)

getAs 6 5
-- 4 (110,101 ⇒ 100)


References

Clone this wiki locally