On 4/3/06, Alan Oswald <[EMAIL PROTECTED]> wrote: > > Many, many thanks for the answers, particularly about the compiler panel. > Not quite sure what the following means > > >I mentioned the issue before with random numbers, but >here we go again: > >never use modulo, use divison instead for scaling to the >right range of > >numbers. mod tends to not deliver good sequence of >random numbers! > > > >Christian
When you ask for a "random number" from the computer, it is usually not really random, in the sense that there are discernible patterns in the generated numbers that you could spot with enough analysis. (Sometimes it is "pseudorandom" in the sense that the patterns repeat; other times it is just e.g. more random in the low-order bits.) If you don't care that the sequence be genuinely random, fine, use mod. (E.g. if you simply want a nondeterministic choice for a single element.) If you really want it to behave randomly (e.g. you're making multiple random choices are want full coverage), using mod may apparently generate pathological behavior (e.g. never returns the same number twice in a row, so certain possibilities never materialize). I think this is the gist. -Max -- Be pretty if you are, Be witty if you can, But be cheerful if it kills you. _________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
