fix: Use internal seed for RANDOM on GC3.2#406
Conversation
|
Nice find! I had only looked at the outdated HTML version of the GnuCOBOL Programmer's Guide, which is for GC 3.1 RC-1 and states:
The newer one available here (https://gnucobol.sourceforge.io/guides.html) states:
Confirming that on GC 3.2, manual seeding is not required. However, both versions of the guide also state:
Which leads me to believe that the previous code was not incorrect, although of course there is no harm in being explicit. |
Note that this is an extension - if you look at the standard (I was allowed to share the draft, so we have kind of an "open" definition) and at most (all?`) other language references you'll see the hard rule (which is the reason that the code did not compile on other environments). side-note: The standard reference was missing in our internal doc, so I've created https://sourceforge.net/p/gnucobol/bugs/1202/ to allow it to be fixed. Thanks for pointing that out. I've included your suggestions but that's now 3 commits - feel free to close and just directly edit the lines with the result or squash-merge. |
which needs to be a numeric value, not a substring containing numeric data ... and let GC3.2 do its magic of self-seeding
|
That's awesome! Thanks for sharing the draft! |
The seed needs to be a numeric value, not a substring containing numeric data ... and let GC3.2 do its magic of self-seeding