![]() |
integer print not making any sense.
Hi, We are implementing a simple digital moving average filter of the output of the p1_y and p1_x. We are pretty much summing 8 numbers that should be in the range of 0-30 therefore should get an output of around 0-240...however this isn't the case for us. We are getting an output of something in the 7000s.
Thanks for your help! Windell Below is the code: Quote:
|
Re: integer print not making any sense.
To print unsigned integers, use %u instead of %d.
Very odd things can occur when printf uses the wrong specifier for the format, the least of which are unexpected values being printed. --Eric |
Re: integer print not making any sense.
Thanks esquared! That makes a lot of sense! I'm so used to only %f,%d,%s from writing C programs on Linux boxes that I didnt think of that.
|
| All times are GMT -5. The time now is 00:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi