4 ms·
If you replaced the sine function with a sawtooth wave (n - floor[n]), you would have continuous, uniformly distributed "pseudorandom" numbers from this method.
by pclmulqdq 3y ago
If you replaced the sine function with a sawtooth wave (n - floor[n]), you would have continuous, uniformly distributed "pseudorandom" numbers from this method.
I think the round() function in CSS is still experimental, but you may be able to get a similar effect by intentionally underflowing a floating-point calculation.
Arcsin(sin(x)) would also work, or arccos(sin(x)), but you would probably have to make an approximation of arcsin/arccos for yourself.
- gus_massa 3y agoI agree, but for a continuous function you need abs((n - floor[n])-1/2)*2 https://www.wolframalpha.com/input?i=abs%28%28n+-+floor%5Bn%5D%29-1%2F2%29*2 https://www.wolframalpha.com/input?i=abs%28%28n+-+floor%5Bn%...