How to find a good saw function for PRNG?
-
04-11-2019 - |
Вопрос
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:
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):
Нет правильного решения
Не связан с cs.stackexchange