The random number generator without special functions

Affiliates: 0,01 $how to earn
Pay with:
i agree with "Terms for Customers"
Sold: 2 last one 15.11.2017
Refunds: 0

Uploaded: 29.12.2013
Content: genereator.doc 24,5 kB


The need for random number generator occurs quite often. And we are not talking about the built-in functions such as Random (). We are talking about their own generator or an algorithm of such a generator. Only at first glance it is a trivial problem. Try to write yourself a generator and you will see that it is not easy. You are offered two programs (Pascal), generating random numbers, and special features are not used. The text of the program is very easy to understand and rewrite them in any programming language. The basis of the algorithm has recurrently expression, the treatment to which the parameters obtained in the previous step, and allows you to generate the next random number. The coefficients are chosen for two cycles - a length of 64, the other - 65536. Generated by integers of the range. The main advantage of the algorithm that kazhnyj random number range is generated exactly once. Try to find a built-in function. It is easy to rewrite the algorithms so that the numbers are not integers, and range for example from 0 to 1. In one of the programs is illustrated, but by comparing the program easily return to integers. The program is very short, work fast, differ only in a set of coefficients and variable types. The program algorithm can be adapted to other intervals for integers, but will have to tinker (requires knowledge of mathematics).

Additional information

You get a file in * .doc, which serves as the text of the two programs (the program - 12 lines with operators O and call).


No feedback yet.
In order to counter copyright infringement and property rights, we ask you to immediately inform us at the fact of such violations and to provide us with reliable information confirming your copyrights or rights of ownership. Email must contain your contact information (name, phone number, etc.)