|
|
|
|
|
by torotonnato
1538 days ago
|
|
Of course, it's uniform. I always swap the two names randomly hehe.
I understand your code. The difference with the snippet I posted (which, btw,
is not mine) is that the difference between successive floats is always a constant, i.e. there is no rounding.
It's fast, has 23 bits of entropy and it's suited for constrained platforms/small demos [0], since it can be coded with very few asm instructions. I'm not saying that your solution hasn't its merits, well done. [0] The author of the code is a known member of the demoscene |
|
All operations (add/sub, mul/div, sin, exp, log, etc...), with IEEE754 floats are defined using real arithmetic, and then assumed to round to the nearest representable floating point value. I don't see why random number generation, at least as a default before micro-optimizing, should be any different.