On Mon, Sep 19, 2016 at 9:11 PM, Matteo Bruni matteo.mystral@gmail.com wrote:
On Mon, Sep 19, 2016 at 8:12 PM, Matteo Bruni matteo.mystral@gmail.com wrote: I have been talking a lot to Elias Vanderstuyft recently, we are aware of precision problems and are working to fix it a in better way. For now I'm sticking the simple changes that I'm able to test in my real hardware. The limit of phase is 35999 because it is related to degrees / 100, more than that would wrap. You are probably right that we need to clamp to max value before calculating.
I don't know if we need to clamp or not. My guess is that it just repeats periodically after that, if such values are allowed at all (SetParameter might fail). I.e. I would have used something like (phase % 36000) instead of clamping. That probably means some more tests are required...
It is important to note that although we are losing precision you can't really notice it in a standard gamepad.
Sure but it still seems like a good idea to do things right when reasonable. Notice that I don't mean to blame you or the patch, I had a bit of a look at the existing code after all...
Yes, I agree that if we can make it better it should be better. I just lack the math skills sometimes for things that may look obvious for other people, I even considered opening questions at http://math.stackexchange.com to help improve some equations.