Durability
#10
Hmm, true, the division might not be the best, but many times, I would say it is probably still faster then all the work needed to build a table. Although I must admit my timing knowledge, especially in recent processors, is limited.

And yes, you must know in advance :) That is perhaps the biggest thing though. "My" method (I did not invent it, don't remember were I read it though), has the advantage that one do not need to actually "save" the info somewere. One can for example calculate the probabiloity on the fly so to speak. One can also stream unknown info (well, of known format) without having to save it and so on.

I have to test that divsion thing some day to see how much "time" and thus code one can have and still be faster than it. There is less shuffling of data for sure when one don't need to build a table for example.

By the way, my post was not primarilly for you (I had a faint idea I discussed it with you but was not sure), but just in general. I personally like the method, especially when one isn't in a time critical situation since it is much "simpler" than to have to build a table, and I don't like the "loop until it works" solution.

Thanks for the comments though.
There are three types of people in the world. Those who can count and those who can't.
Reply


Messages In This Thread
Durability - by Archon_Wing - 03-14-2003, 03:58 AM
Durability - by Isolde - 03-15-2003, 07:01 PM
Durability - by Archon_Wing - 03-15-2003, 08:04 PM
Durability - by Conner Macleod - 03-15-2003, 10:07 PM
Durability - by Isolde - 03-16-2003, 12:05 AM
Durability - by Elric of Grans - 03-16-2003, 06:13 AM
Durability - by Jarulf - 03-16-2003, 01:03 PM
Durability - by Jarulf - 03-16-2003, 02:49 PM
Durability - by Isolde - 03-16-2003, 06:03 PM
Durability - by Jarulf - 03-16-2003, 06:14 PM
Durability - by Isolde - 03-16-2003, 07:02 PM
Durability - by Jarulf - 03-16-2003, 10:26 PM
Durability - by Loschonorg - 03-17-2003, 03:10 AM
Durability - by myrdinn - 03-18-2003, 01:42 PM
Durability - by Archon_Wing - 03-18-2003, 10:49 PM
Durability - by dectgap - 03-23-2003, 09:13 PM
Durability - by Archon_Wing - 03-23-2003, 10:02 PM
Durability - by Bolty - 03-23-2003, 10:07 PM
Durability - by dectgap - 03-23-2003, 10:31 PM
Durability - by Sheep - 03-24-2003, 04:00 AM
Durability - by Isolde - 03-24-2003, 04:14 AM
Durability - by Conner Macleod - 03-24-2003, 05:01 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)