
errorprone.bugpattern.RandomCast.md Maven / Gradle / Ivy
The newest version!
`Math.random()`, `Random#nextFloat`, and `Random#nextDouble` return results in
the range `[0.0, 1.0)`. Therefore, casting the result to `(int)` or `(long)`
*always* results in the value of `0`.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy