Thank you both for your replies. I changed power to a long long and it is working perfectly. I understand that there *could* be a performance loss from doing that as you are looping much more times checking invalid rooms, however I have run a test using this and generating 100 valid random room vnums using get_random_room and I notice no performance hit, it gives me 100 results immediatly. That is not to say that there is not a performance hit though as I'm sure there is, but in a mud I can't see that this particular hit will affect overall performance enough to not use it as it stands.
Once again thank you for the fix and information regarding the operand. Matt Bradbury -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Barton Sent: Wednesday, March 26, 2003 07:39 PM To: Tiikuli; Hiddukel Cc: 'Rom Mailing List' Subject: Re: number_range problem > I bet that it hangs because the value overflows (becomes negative), thus > never actually reaching 'to'. Yeah, slight problem here... I'm not sure there's an easy way to fix it without changing power to a "long long", which could impact performance.. You can fake it, of course. long vnum; vnum = number_range(0, 21474) * 100000; vnum += number_range(0, 83647); room = get_room_index(vnum); er.. it's really not a very good algorithm if you've only filled, say, 0.01% of 2 billion rooms, though. It could take a while to find a valid room in all that. --Palrich. -- ROM mailing list [email protected] http://www.rom.org/cgi-bin/mailman/listinfo/rom

