Random numbers 
Author Message
 Random numbers

Hi

This is probably a very simple question and I'm not even sure if it belongs
in this ng. If the question is off-topic, I apologize.

Does anyone have an example on how to generate a list of unique random
numbers in PL/I? I want to be able to generate n integers between a and b,
i.e. generate 200 random numbers between 1 and 10000.

I use PL/I under MVS/ESA. I've heard that the PC-version has a random
function, but unfortunately I don't have it.

Sincerely, H?kan M?ller



Mon, 12 Mar 2001 03:00:00 GMT  
 Random numbers

 on Thu, 24 Sep 1998 18:13:32 +0100,

Quote:
>Hi

>This is probably a very simple question and I'm not even sure if it belongs
>in this ng. If the question is off-topic, I apologize.

>Does anyone have an example on how to generate a list of unique random
>numbers in PL/I? I want to be able to generate n integers between a and b,
>i.e. generate 200 random numbers between 1 and 10000.

>I use PL/I under MVS/ESA. I've heard that the PC-version has a random
>function, but unfortunately I don't have it.

>Sincerely, H?kan M?ller

Here's the complete PL/I source code for a (simple) power residue random
number generator, from C.T. Fike's book: "PL/I for Scientific Programmers".
      Random:
          Proc Returns(Float Bin(21));
          Dcl R Fixed Bin(31) Init(452807053) Static;
     (Nofofl): R = R*452807053;
          Return(R*0.465661e-9);
          End;

 Random returns a random floating point number (FLOAT BIN(21)) that is
 between 0.0 and 1.0; The algorithm only works on S/390 type machines,
 but thats no bug deal since you're running MVS on S/390. It should be
 easy for you to expand upon this code to make a routine that does
 exactly what you want... Enjoy.

Dave Jones



Mon, 12 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Random Number Generator to produce SAME random number from 12:00am-11:59pm

2. Random number not random?

3. Pentium III processor number and random number generator

4. J random-number generator: what is used?

5. Quasi Random numbers

6. How do I get random numbers with ALC?

7. [VA] Random Numbers!

8. Problem with random numbers

9. Random number generators

10. Random number generators

11. Random number algorithims

12. WANTED: Assembly code for random numbers

 

 
Powered by phpBB® Forum Software