Skip to content

Files

Latest commit

 

History

History
25 lines (18 loc) · 347 Bytes

Lint-RandOne.md

File metadata and controls

25 lines (18 loc) · 347 Bytes

Pattern: Use of rand(1)

Issue: -

Description

This rule checks for rand(1) calls. Such calls always return 0.

Examples

# bad
rand 1
Kernel.rand(-1)
rand 1.0
rand(-1.0)
# good
0 # just use 0 instead

Further Reading