Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
L ldpl
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 8
    • Issues 8
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Lartu
  • ldpl
  • Issues
  • #90

Closed
Open
Created May 11, 2019 by Lartu@lartu🐕Maintainer

Random numbers not so random

Created by: dvkt

Maybe the seed is constant by accident? I get the same results each time, it seems:

$ cat rand.ldpl 
DATA:
r is number
i is number

PROCEDURE:
while i is less than 5 do
  store random in r
  display r crlf
  incr i
repeat
$ for i in {1..5}; do echo "# ${i}"; ./rand-bin; done
# 1
0.365382414946976
0.982248013830859
0.642368455250919
0.28662740219693
0.346748723809956
# 2
0.365382414946976
0.982248013830859
0.642368455250919
0.28662740219693
0.346748723809956
# 3
0.365382414946976
0.982248013830859
0.642368455250919
0.28662740219693
0.346748723809956
# 4
0.365382414946976
0.982248013830859
0.642368455250919
0.28662740219693
0.346748723809956
# 5
0.365382414946976
0.982248013830859
0.642368455250919
0.28662740219693
0.346748723809956
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking