RND() function seems biased

From Liberty BASIC Family
Revision as of 14:22, 14 September 2020 by StPendl (talk | contribs) (Text replacement - "Bug Tracker Categories" to "Bug Tracker")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

The RND() function seems to result in a predictable sequence of numbers despite of changing the seed for each execution of RND().

Example code to demonstrate the bug.

Carl requesting pointers to a better algorithm at the old community forum

Example code to work around the bug.

As a solution, see the Mersenne Twister thread at the old community forum.