Opened 11 years ago
Closed 11 years ago
#2977 closed Bug (Fixed)
Random() returns zero on statistically valid inputs
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.12.0 | Severity: | None |
| Keywords: | Cc: |
Description
Hi devs,
This appears to be coded intentionally to behave like this (from reading the Help documentation), but the behaviour itself is simply wrong.
$test=Random(1,1,1) MsgBox(0,@error,$test)
This currently yields 0, presumably because the range is zero. But this is a conceptual mistake.
Consider a vase with a variable (N)umber of balls, numbered consecutively 1-N. If there are three balls (labelled 1,2,3 resp.), my chances of pulling out ball 1 are 1 in 3. If there are two balls, the chance of pulling out ball 1 is 50%. But if the vase contains only ball 1, my chances of pulling out ball 1 are of course 100%, not zero/error.
Exepcted Behaviour: If min=max, return min (or max)
Anything else is counter-intuitive and statistically indefensible.
Cheers,
RT
Attachments (0)
Change History (2)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
| Resolution: | → Fixed |
|---|---|
| Status: | new → closed |
Exactly, latest beta fixes that.

This is already changed to expected behavior in latest beta versions.