??? 07/07/06 12:38 Modified: 07/07/06 12:44 Read: times Msg Score: +1 +1 Informative |
#119803 - Implicit casting mess. Responding to: ???'s previous message |
float time = 0.0; This creates a whole obscure mess of implicit casts (not to mention that float arithmetic is slow on a '51 and should be avoided, especially in an ISR). As a general rule, don't use float when you could use fixed-point arithmetic instead. The division in your program is probably still done in integer, yielding a zero result, which in turn then leads to a division by zero. If you really think you have to use float (which you probably don't), try explicit casts. |
Topic | Author | Date |
frequency of a digital pulse | 01/01/70 00:00 | |
Variable definitions ? | 01/01/70 00:00 | |
Please post formatted code | 01/01/70 00:00 | |
Some points: | 01/01/70 00:00 | |
misconceptions cleared | 01/01/70 00:00 | |
inappropiate response | 01/01/70 00:00 | |
the entire problem again | 01/01/70 00:00 | |
flag=!flag ? | 01/01/70 00:00 | |
The value of Flag is known! | 01/01/70 00:00 | |
I see, but I don't C | 01/01/70 00:00 | |
It's illogical, Captain... | 01/01/70 00:00 | |
It is worse than that![]() | 01/01/70 00:00 | |
nope | 01/01/70 00:00 | |
Please post formatted code!! | 01/01/70 00:00 | |
he did follow the instructions | 01/01/70 00:00 | |
Oh no he didn't! | 01/01/70 00:00 | |
Argument | 01/01/70 00:00 | |
well, I saw the indentions and - shame | 01/01/70 00:00 | |
formatted code................. | 01/01/70 00:00 | |
thus therefore undefined | 01/01/70 00:00 | |
Formatted, but not the same code! | 01/01/70 00:00 | |
2 problems off the top | 01/01/70 00:00 | |
a blatant understatement | 01/01/70 00:00 | |
Implicit casting mess. | 01/01/70 00:00 | |
commentless code is worthless | 01/01/70 00:00 |