Re: flags in a bitmap

Bill Allombert <[email protected]>
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <aGmQwPmM1MAxO6hJ@seventeen>
On Sat, Jul 05, 2025 at 09:19:19PM +0200, Ruud H.G. van Tol wrote:
> 
> On 2025-07-05 20:37, Bill Allombert wrote:
> > [...]
> > I have made a updated version (which no more allow to clear the highest bit).
> 
> ? ??bitclear
> 'bitclear' not found !

You need to do 'make install-doc' (You can set a custom prefix with Configure).

> ? ?bitset
> bitset(~x,n): set bit n of x in place, assuming x >= 2^n.
> 
> ? ?bitclear
> bitclear(~x,n): clear bit n of x in place, assuming x >= 2^(n+1).
> 
> ? ?bitflip
> bitflip(~x,n): flip bit n of x in place, assuming x >= 2^{n+1}.

Good catch! I have made a new push.

I added examples to the documentation.

I still need one example for bitflip, if you have some ideas!

Cheers,
Bill.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.