|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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:
|
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HELP any tips for making promotional videos | efoote868 | Fundraising | 3 | 19-07-2006 23:19 |
| Ok, this does not make sense.... | Michael Hill | Math and Science | 6 | 19-10-2005 17:42 |
| integer division | ImmortalAres | Programming | 5 | 11-07-2005 21:19 |
| Kickoff is running again, @ 11:50 am - NOT ANY MORE!!! :( | Elgin Clock | General Forum | 4 | 08-01-2005 22:30 |
| Integer Number | powercat | Programming | 2 | 18-02-2003 11:26 |