make-binary-bits ( number -- binary-bits )
Factor handbook » The language » Numbers » Arithmetic » Bitwise arithmetic » Integer virtual sequences

Prev:<binary-bits> ( number length -- binary-bits )


Vocabulary
math.bits

Inputs
numberan integer


Outputs
binary-bitsa binary-bits


Word description
Creates a sequence of binary-bits in ascending significance. Throws an error on negative numbers.

Examples
USING: math.bits prettyprint arrays ; 0b1101 make-binary-bits >array .
{ 1 0 1 1 }

USING: math.bits prettyprint arrays ; 64 make-binary-bits >array .
{ 0 0 0 0 0 0 1 }


See also
<binary-bits>

Definition