Sujet : Re: lun - Lucky Number
De : 333200007110-0201 (at) *nospam* ybtra.de (Marcel Logen)
Groupes : sci.cryptDate : 16. Mar 2025, 15:57:20
Autres entêtes
Organisation : Bureau Logen
Message-ID : <87v7s911d2.fsf@pc-731.ybtra.de>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Richard Heathfield in sci.crypt:
[...]
I knocked up a quick sieve for you so that you can see the macros
being used in another context - here, to tick off compounds (by
which I mean non-primes) a la Eratosthenes.
It works. :-)
(I also fixed a tiny
and probably harmless bug in BIT_QRY, where x was insufficiently
parenthiprotected.)
>
#include <stdio.h>
>
#define BIT_QRY(x,i) (((x)[(i)>>3] & (1<<((i)&7)))!=0)
This is actually another C question:
Why does it have to be "(x)" and "(i)" everywhere instead of
"x" and "i"? What kind of "protection" is meant here?
Marcel
-- Sun Mar 16 15:57:20 2025 CET (1742137040)pc-73187 v7s9 11d2Lines: 29