Integer virtual sequences

Factor handbook » The language » Numbers » Arithmetic » Bitwise arithmetic

Factor handbook » The language » Numbers » Arithmetic » Bitwise arithmetic

Prev: | Additional bitwise arithmetic |

The math.bits vocabulary implements words that represent a positive integer as a virtual sequence of bits in order of ascending significance, e.g. { f f f t } is 8.

If you need binary digits instead of boolean, then you can use these:

bits

<bits> ( number length -- bits )

make-bits ( number -- bits )

bits>number ( seq -- number )

If you need binary digits instead of boolean, then you can use these:

binary-bits

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

make-binary-bits ( number -- binary-bits )

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.100 x86.64 (2281, heads/master-20276adfbc, Sep 6 2024 14:17:49)