Skip to content

interleave

Subhajit Sahu edited this page Jan 23, 2021 · 4 revisions

Interleave bits of two Int16s. 📰 📘

Similar: merge, interleave.


interleave x y
-- x: first Int16
-- y: second Int16
-- --> Int
import Bit exposing (..)

interleave 0x0000 0xFFFF
-- 1431655765 (0x55555555)

interleave 0x1234 0x1234
-- 51121968 (0x030C0F30)

interleave 0x1234 0x4321
-- 302845473 (0x120D0E21)


References

Clone this wiki locally