> You can convert a number to a Boolean array, in which each element
> represents one bit, and you can convert a Boolean array to a number, so you
> can manipulate in both directions. The individual Boolean is the closest to
> what you'd call a "bit" datatype. The functions are in the "Boolean" section
> of the standard function palette. A more detailed response needs a more
> detailed question.
>
> As a matter of curiosity to anyone else reading this, a single 32 bit wide
> memory access can return a U32 for a given operation. If that U32 is
> converted to a Boolean array, does it then require 32 memory accesses to
> perform the same operation on it?
This approach will work quite well, but anothr approach is to simply leave
the data in numerics and AND/OR o
r with whatever bit pattern you are trying
to manipulate. This may seem more complicated, but it will end up using less
memory and take less time, if that is important. Also, lots of people don't
know that the Boolean operations will also work on integers, N bits at a time.
To answer the next question, a 32 bit number will be converted into 32 Booleans.
In LV5 and greater, that will be stored in 32 bytes. If you need to
copy the
Boolean array, then that will happen multiple element at a time, but most
logical operations will happen one byte, one Boolean at a time. When converted
back into a numeric, 32 adjacent Booleans will be recombined to form a number.
Less bits for different numeric types.
The Boolean arrays before LV5 were actually packed together into words, taking
less memory, but more processing to manipulate.
Greg McKaskle