Author: Robert Sample
Posted: Fri Sep 02, 2016 6:27 pm (GMT 5.5)
From ther Enterprise COBOL Language Reference version 6.1 manual:
You can use over 2 billion starting seeds -- hence you can have over 2 billion random values.
And the 31 bits all matter -- unless you consider 1.234567 times 10 to the 30th power to be the same value as 1.234567 times 10 to the minus 63rd power. Yes, the mantissa's 24 bits will be the same but the exponent's 7 bits will give you a different value for the number.
_________________
TANSTAAFL
The first rule of code reuse is that the code needs to be worth re-using.
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth
Posted: Fri Sep 02, 2016 6:27 pm (GMT 5.5)
Quote: |
If it returns a 32 bit number, which seems most likely, it has a 1 bit sign, a 7 bit exponent, and a 24 bit value. Don't worry about this ânormalizedâ or âunnormalizedâ business â that's just computer number geek talk, though the difference might affect scaling the number to the character set. What's important is 24 bits, which means 2^24 unique values. This is a large number, but it is much less than the 2 billion Mr. Sample innocently talked about. |
Quote: |
argument-1 If argument-1is specified, it must be zero or a positive integer. However, only values in the range from zero up to and including 2,147,483,645 yield a distinct sequence of pseudorandom numbers. If a subsequent reference specifies argument-1, a new sequence of pseudorandom numbers is started. |
And the 31 bits all matter -- unless you consider 1.234567 times 10 to the 30th power to be the same value as 1.234567 times 10 to the minus 63rd power. Yes, the mantissa's 24 bits will be the same but the exponent's 7 bits will give you a different value for the number.
_________________
TANSTAAFL
The first rule of code reuse is that the code needs to be worth re-using.
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth