-
About random&round&clamp
r = Math.round(random(-1,1))
v = clamp(r,0,1)Why Mr.Frank said that the result has 1/3 chance get 1?
think about that:
-1 to-0.5 –> -1
-0.5 to 0.5 —> 0
0.5 to1 –> 1
Why not 1/4?
r = Math.round(random(-1,1))
v = clamp(r,0,1)
Why Mr.Frank said that the result has 1/3 chance get 1?
think about that:
-1 to-0.5 –> -1
-0.5 to 0.5 —> 0
0.5 to1 –> 1
Why not 1/4?
We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy