On Jan 31, 2008 11:09 AM, Alberto Luaces <[EMAIL PROTECTED]> wrote: > I think it was more important for the original writer to get high quality > random numbers than to match the exact range. Maybe the documentation should > be changed in order to say that it returns min < x <= max, or the function, > decrementing the max arg passed one unit, so the value returned could be min > < x <= max-1 which would mean min < x < max when dealing with integers. >
Matching the exact range is extremely important, as otherwise you can get weird bugs when you get the values outside, which will happen exceeding rarely, making them very hard to debug. Also, if the implementation really is > minimum + (maximum - minimum) * rand() / RAND_MAX; then the range is neither (min,max] nor (min,max) -- it's [min,max] _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

