Mail Archives: djgpp/1999/02/05/01:32:39
At 04:18 AM 2/5/99 +0100, you wrote:
>thanks, but i need a flexible routine like the one i posted earlier,
>you said it was too complex, but it really lets you specify wich bit
>to set/reset :)
To set bit d of n:
n |= (1<<d); 1<<d == 00010000 (1 in pos. d).
To reset bit d of n:
n &= ~(1<<d); ~(1<<d) == 11101111 (0 in pos. d).
--
.*. "Clouds are not spheres, mountains are not cones, coastlines are not
-() < circles, and bark is not smooth, nor does lightning travel in a
`*' straight line." -------------------------------------------------
-- B. Mandelbrot |http://surf.to/pgd.net
_____________________ ____|________ Paul Derbyshire pderbysh AT usa DOT net
Programmer & Humanist|ICQ: 10423848|
- Raw text -