Sign in
chromium
/
external
/
github.com
/
google
/
error-prone
/
refs/heads/copybara-sync
/
.
/
docs
/
bugpattern
/
RandomCast.md
blob: e89e6f4c29dd2f6d1a4d5fcec6bc5606be30a60e [
file
] [
log
] [
blame
] [
view
] [
edit
]
`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`
.