asmr coding PRNG function in Fortran #asmr #coding #programming #notalking #fortran
asmr coding Pseudo-random number generator function in retro Fortran no-talking, in emulated 80286 / MS-DOS machine in DOSbox. This program implements a pseudo-random number generator (PRNG) by using the classic Mixed-Congruential Sequence (linear) method, as it was described by D. Knuth (1972) regarding proper parameter choices for high-entropy output.
The general rules for parameter choice are:
1) M (modulo) must be at most half the available bits width of the integer type used.
2) C (increment) should be chosen close to the value: M * (1/2 - sqrt(3)/6) = 0.2113248654051871... For example: M=2^8 gives C=54 (54.09916...)
3) A (multiplier) should be chosen as to satisfy the following three requirements: A mod 8 = 5 , A between M/100 and M-sqrt(M) , A must not have trivial bit pattern value.
Then these three values, along with a user-provided seed value X0, can be used iteratively with:
X(n+1) = (A * X(n) + C) mod M , X(0)=X0
Provided that all constraints are satisfied, there are various 'good' choices for the triplet (A,C,M) and any one of them should provide a random sequence with a period of M before repeating. High-quality PRNG functions are crucial in simulation experiments.
Note: Older compilers keep returning arithmetic overflows even when intermediate calculations are made via REAL and IFIX or INT/NINT. Thus, the BITS internal parameter should be set no larger than half the available bits width for the integer type used for A, C, M. Larger values may return correct results, but this is not guaranteed. For faster output, the parameters can be fixed to pre-initialized well-performing set of values.
Warning: In some older versions of Microsoft's Fortran 77, the batch process 'FORT.BAT' assumed that the input filename is given as argument *without* the '.FOR' extension. If it is given, then the output is unpredictable and usually results in a corrupted *original* (source) file! Make sure to always keep backup before compiling - I had to write the source code twice because of this.
Enable captions for more details and walk-through. Source code available at the Github repository (see channel info).
#asmr #coding #programming #notalking #fortran #retro #msdos #dosbox
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «asmr coding PRNG function in Fortran #asmr #coding #programming #notalking #fortran», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.