Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] caved in: Algorithms for for storing free space.
On Sun, 5 Apr 1998, Chris Gray wrote:
> [Ben Greear:]
>
> :A binary search wouldn't be too bad, just wondering if there's
> :a better (constant) method??
>
> Isn't there one of those bit-twiddle methods that does that? Or can you
> only find the lowest one bit or something? Not sure where to look for
> the stuff, however. Anyone?
I thought of this..might be ok:
int pwr = 0;
int size; //this is what we want to find
int i = 0;
while ((size >> i) > 0) {
pwr++;
i++;
}
pwr should be the base of two you'll need.
This is a messy example..and might not even work...just a working
idea.....
Ben
Ben Greear (greear#cyberhighway,net) http://www.primenet.com/~greear
Author of ScryMUD: mud.primenet.com 4444
http://www.primenet.com/~greear/ScryMUD/scry.html
- Thread context:
- [MUD-Dev] Re: MUD Development Digest, (continued)
- [MUD-Dev] GRUPMS?,
Vadim Tkachenko vt#freehold,crocodile.org, Mon 06 Apr 1998, 04:58 GMT
- Re: [MUD-Dev] caved in: Algorithms for for storing free space.,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Sun 05 Apr 1998, 18:39 GMT
- Re: [MUD-Dev] internet connections,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Sun 05 Apr 1998, 16:41 GMT
- Re: [MUD-Dev] (fwd) Re: Roleplaying,
Travis Casey efindel#polaris,net, Sun 05 Apr 1998, 04:00 GMT
- Re: [MUD-Dev] Character development [was Re: ],
Travis Casey efindel#polaris,net, Sun 05 Apr 1998, 02:42 GMT
[ Other Periods
| Other mailing lists
| Search
]