3 ms·
Now that you mention it, that would also be an issue for the technique you describe; specifiable to the rounding characteristics for truncated numbers. It's pr
by mjevans 12y ago
Now that you mention it, that would also be an issue for the technique you describe; specifiable to the rounding characteristics for truncated numbers.
It's probably a better design idea to have a predictable sequence of float (like, application dependent) results and randomly select from within said sequence.
- ZoFreX 12y agoIn my (naive and possibly flawed) tests, the division method is giving uniformly distributed results. Can you explain more what the limitations of that approach are?
- lmm 12y agoThe default rounding method is round-to-even, so e.g. 0.9999999 would be expected to come up slightly more often than 0.99999994 (the last two floats smaller than 1). Being more precise would probably require thinking about all the possible int values.