Quote:
|
Originally Posted by Mike Betts
...Integer arithemetic! You are multiplying by 1... Try doing the math outside of the printf. Multiply by 6987 and store into a long int variable. Now divide by 10000 and store in an int variable. Now printf your int.
|
Or multiply by 45788 (2^16 * 0.6986666...) and then right shift sixteen bits or just grab the high order sixteen bits of the thirty-two bit long. Man, I dig this stuff <grin>.
-Kevin