Re: x >> x

From: George (greerga@CIRCLEMUD.ORG)
Date: 07/24/98


On Fri, 24 Jul 1998, I Chose No Name wrote:

>okay, i just need a lil help here :)
>i need to convert a (1 >> 7) [which is 128] into
>7...but i have like a variable 128 that i got from
>1 >> 7, and i need to convert it back into 7...any help?

(1 >> 7) is 0.
(1 << 7) is 128.

i.e.:
#define ROOM_NOMAGIC            (1 << 7)   /* Magic not allowed         */

--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://patches.van.ml.org/          | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/    |                  -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST