Pattern: Use of rand(1)
Issue: -
This rule checks for rand(1)
calls. Such calls always return 0
.
# bad
rand 1
Kernel.rand(-1)
rand 1.0
rand(-1.0)
# good
0 # just use 0 instead
Pattern: Use of rand(1)
Issue: -
This rule checks for rand(1)
calls. Such calls always return 0
.
# bad
rand 1
Kernel.rand(-1)
rand 1.0
rand(-1.0)
# good
0 # just use 0 instead