S
sdd
I am whacking away at some code to view numbers as bit sequences.
While this is not complete, I'd appreciate some feedback from anyone
who is interested in looking at it:
http://members.dsl-only.net/~daniels/bits.html
As the page describes, bit extract of more than an int's worth of bits
from a long at one go does not yet work.
The basic idea is that the (non-complex) python numbers can be
viewed as an infinite binary bit stream:
...........000101.11000..... is 5.75
There are functions to get the least and most significant bit
numbers, examine a particular bit, and extract a consecutive
chunk of bits.
At the bottom of the page are links to source archives and windows
installers for 2.2 and 2.3.
For now, consider this a pre-alpha. I am soliciting comments
on both the definitions and names of the functions provided.
However, I'd like to point out now that negative integers have
an infinite number of ones _and_ zeros in their expansion above,
so popcount as traditionally defined for negative integers is
unworkable.
-Scott David Daniels
(e-mail address removed)
While this is not complete, I'd appreciate some feedback from anyone
who is interested in looking at it:
http://members.dsl-only.net/~daniels/bits.html
As the page describes, bit extract of more than an int's worth of bits
from a long at one go does not yet work.
The basic idea is that the (non-complex) python numbers can be
viewed as an infinite binary bit stream:
...........000101.11000..... is 5.75
There are functions to get the least and most significant bit
numbers, examine a particular bit, and extract a consecutive
chunk of bits.
At the bottom of the page are links to source archives and windows
installers for 2.2 and 2.3.
For now, consider this a pre-alpha. I am soliciting comments
on both the definitions and names of the functions provided.
However, I'd like to point out now that negative integers have
an infinite number of ones _and_ zeros in their expansion above,
so popcount as traditionally defined for negative integers is
unworkable.
-Scott David Daniels
(e-mail address removed)