Вопрос

As part of an assignment I have to write a PRNG using a sin (or any other trigonometric function) and a saw function which I'm struggling a bit with. So how would you find a good saw function with about equal distribution?

This is what it is supposed to look like: enter image description here

There are two functions I've got now,

y=(seed/1000*state*49) mod 101 and

z=(y-1 % 10) / 10)

and distribution looks like this (I'm not fine with that 1 and 0 distribution):

enter image description here

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с cs.stackexchange
scroll top