Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

COBOL Programming :: RE: Random Password (in string format) generation.

$
0
0
Author: steve-myers
Posted: Fri Sep 02, 2016 7:40 pm (GMT 5.5)

Unfortunately, I only have access to Enterprise COBOL for z/OS V4.2 Language Reference. The first sentence for RANDOM says,
Quote:
The RANDOM function returns a numeric value that is a pseudorandom number from a rectangular distribution.
It says nothing about how the 2^31 values in the integer sequence are mapped to the 2^24 values in the 32 bit floating point number. By definition, there will be repeats. If the 31 bits are not mapped properly, IBM's claim of a “rectanglar distribution” is pure horse s***. I can state with confidence that unless the floating point value is normalized the exponent will always be X'40'.

Since I don't do Cobol, I have no way to test anything, both to test claims about the distribution or to determine if the returned value is normalized.

Unfortunately, fine details about number theory are out of my league, so I better quit.


Viewing all articles
Browse latest Browse all 8500

Trending Articles