Re: Zone limits

From: Pink Floyd (floyd@south.mit.edu)
Date: 11/24/95


   > I would like to change this value to a signed int which would be a 32
   > bit value. 

   Well, your on the right track, a signed int will give you a little over 
   32000 above and below zero.  if you change it to an unsigned int, then 
   you can go up to a little over 65000 (positive only).  but as long as the 
   compiler and such will handle it, (and as long as your doing the work) 
   why not change it to something like a long (+-)2 billion, 147 million, or 

   if ou wanted to get really crazy, a unsigned long(+) 4 billion 294 million.

This assumes a 16-bit integer, which is not always the case.  My computer has
a 32 bit integer and a 32-bit long.  The use of short integer for room 
numbers gives 16 bit.  You must also remember that the mud sometimes tests
the value of rooms against -1 which could complicate things if you have 
unsigned values for room numbers. (#define NOWHERE -1)

   I've never tried to change the max size of the rooms, so I don't know 
   what difficulties you'd be getting into, but if you go over 32000, then 
   65000 doesn't seem like it gives you that much more room.  But be 
   careful, because using a long is going to let you eat much more memory 
   (twice as much wherever you declare any values) versus using an int.

Using a signed int on my computer (pentium) gives me over 2 billion rooms, 
more than I could ever possibly need (the manpower required to make a 
2-billion room mud is not practical).

   Just to let you know, an int, and unsigned int is both 16 bit 
   and the long is the 32bit number you were referring to.

See above... I believe the ANSI standard says an int must be _at least_ 16
bits, not _exactly_ 16 bits.
 



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