Buildfest feedback: should $rand exclude 1?

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: 6.0.1
    • Component/s: None
    • ALL
    • QO 2022-10-17, QO 2022-10-31, QO 2022-11-14, QO 2022-11-28
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Should $rand be exclusive of 1? Languages with this type of rand (Java, Python, C#...) exclude 1. This simplifies getElement(int(rand()*length)), since there is no chance (however minor) of going out of bounds, which a user may be caught off guard by.

      Otherwise, is there a reason that $rand should include 1?

              Assignee:
              Alexander Ignatyev
              Reporter:
              Maxim Katcharov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: