All being chars ranging from 30 to 255, based in the rate of change of the last, it can predict the new sample.. but when it is growing and close to 255 it overflows, also when diminishing close to 0.
I am looking for a way to avoid overflows in this case and others.
Thank you.
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
The two 10000's should force the math to be done with longs, and avoid any posibility of going negative. Just take 20000 off the end and cast back to int. _________________ The search for better is endless. Instead simply find very good and get the job done.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum