> so long as you multiply the random() result by a good-sized constant before you cast to int, it actually does what it's "supposed" to do.
Yeah but since cast binds tighter than multiplication, any code following the pattern `(int) Math.random() * a` is broken and generates 0 every single time.
Yeah but since cast binds tighter than multiplication, any code following the pattern `(int) Math.random() * a` is broken and generates 0 every single time.
For the code to work, you need `(int) (Math.random() * a)`: http://www.google.com/codesearch?q=\(int\)\s*\(\s*Math\.rand...