Skip to content

icidasset/elm-binary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary

Work with sequences of binary numbers.

>>> [ 1, 0, 0, 0 ]
..>   |> Binary.fromIntegers
..>   |> Binary.shiftRightBy 1
..>   |> Binary.toDecimal
4

>>> 4
..>   |> Binary.fromDecimal
..>   |> Binary.shiftLeftBy 1
..>   |> Binary.toIntegers
[ 1, 0, 0, 0 ]

Convertors

  • Hexadecimal
  • Decimal
  • Integers
  • Booleans
  • Strings

Operations

  • Basics: and, or, xor, not (complement)
  • Shifting: left & right shift, left & right rotation
  • Maths: add, subtract

Utilities

  • Collections: append, chunksOf, concat, dropLeadingZeros
  • Sizing: ensureBits, makeIsomorphic, width