4 ms·
It's pretty common in practice to want [0,1) (that is, 0 <= x < 1) from your random number generator. Never generating 0 would be a problem when the range is sm
by ZoFreX 12y ago
It's pretty common in practice to want [0,1) (that is, 0 <= x < 1) from your random number generator. Never generating 0 would be a problem when the range is small and discrete - generating random letters for example.
- captaincrowbar 12y agoIf you're generating integers, or selecting from a discrete set with uniform probabilities, there's no reason to involve floating point at any point in the process.