Integers as bit arrays

Kevin Ryde user42@zip.com.au
Sat, 12 Jul 2003 09:15:40 +1000


Brian Hurt <bhurt@spnz.org> writes:
>
> invert individual bits

Niels M=F6ller contributed a bit invert, I'd managed to forget about it
until recently.  It'll probably go in the next release.

Add a bit-block copy to your list too, a sort of combination extract
and insert perhaps.

> - "odd" behavior, or serious performance problems, on non-binary systems=
=20
> (BCD mainframes, etc)

We've probably already got problems on non 2s complement binary
systems.

> - violates the mathematic concept of a number

Not really.

> - only applies mpz-s, not mpq-s or  mpf-s

It could apply to mpf without much trouble, if we thought there was a
use for it.  In theory it could apply to mpq too, but that's likely to
be even less useful.