??? 04/13/07 14:31 Read: times |
#137168 - if else statements in keil c51 |
i am using the keil uvision 3 environment to compile c source codes into one 8052 microcontroller(Atmel 8982s52). i am facing difficulty in doing the floating point comparison using if else statements. it always executes the second statement of if else block. can anybody tell me what is wrong?
the part of the code is: a=5.34; if(a>1.2) P1=20; else P1=10; and the output is always P1=10 whatever i put in the condition of the if statement. |
Topic | Author | Date |
if else statements in keil c51 | 01/01/70 00:00 | |
Things to check | 01/01/70 00:00 | |
example | 01/01/70 00:00 | |
And it might help to use hex | 01/01/70 00:00 | |
floating point | 01/01/70 00:00 | |
Not true | 01/01/70 00:00 | |
further... | 01/01/70 00:00 | |
I suggest you read this.. | 01/01/70 00:00 | |
Test Seems To Work | 01/01/70 00:00 | |
SDCC version works also | 01/01/70 00:00 | |
Testing the typo...![]() | 01/01/70 00:00 | |
its a lot easier to use fixed point | 01/01/70 00:00 |