View previous topic :: View next topic |
Author |
Message |
Harry Mueller
Joined: 17 Oct 2005 Posts: 116
|
printf format |
Posted: Sun Dec 11, 2005 10:54 am |
|
|
I would have expected the following code to give me a 101.34 with a value of 10134. What I get is 101.02ld. What am I doing wrong? Compiler vers. is 3.239.
Code: | printf("\r\ngravity = %03ld.%02ld",value/100, value%100); |
thanks....Harry |
|
|
Harry Mueller
Joined: 17 Oct 2005 Posts: 116
|
|
Posted: Sun Dec 11, 2005 11:27 am |
|
|
I just recompiled the program and it now works. Go figure! |
|
|
Harry Mueller
Joined: 17 Oct 2005 Posts: 116
|
|
Posted: Sun Dec 11, 2005 12:41 pm |
|
|
False alarm...just figured out my problem.
I'm not sure why, but as soon as I post a question my thinking gets clearer. Sorry for bothering you guys.
Harry |
|
|
Ttelmah Guest
|
|
Posted: Mon Dec 12, 2005 6:01 am |
|
|
I think most of us were having a weekend off anyway!. :-)
However it is the act of 'verbalising' the problem (though in writing, rather than orally), that often helps with a solution. Describing it to a brick wall/plant/office cat, sometimes works as well, but can lead to people thinking you are having a different type of problem.....
Best Wishes |
|
|
|