??? 02/26/06 10:40 Read: times |
#110815 - Not only but also Responding to: ???'s previous message |
Apart from the evaluation version not supporting floating point, this is a particularly bad piece of C code
1. variable a is an unsigned short yet it is assigned the result of pow() which returns a float or possibly a double (I forget which) 2. pow() expects floating point arguments but it is passed an unsigned short - it should be cast to float. 3. This about the most inefficient way I can think of to raise a variable to a power of 2!!! Yuk!!! Give me assembler any day. Ian |
Topic | Author | Date |
Keil C51 and Math | 01/01/70 00:00 | |
Eval version? | 01/01/70 00:00 | |
Not only but also | 01/01/70 00:00 | |
Come now | 01/01/70 00:00 | |
Come off it | 01/01/70 00:00 | |
poorly typed | 01/01/70 00:00 | |
Typing (sic) | 01/01/70 00:00 | |
Ian | 01/01/70 00:00 | |
What type? | 01/01/70 00:00 | |
any decent compiler will give you a warn | 01/01/70 00:00 | |
it depends | 01/01/70 00:00 | |
Get Promoted | 01/01/70 00:00 | |
Too much promotion! | 01/01/70 00:00 | |
Hells Bells | 01/01/70 00:00 | |
Ding Dong! | 01/01/70 00:00 | |
C vs assembler, take 655321 | 01/01/70 00:00 | |
anyone else will be a programmer in name | 01/01/70 00:00 | |
Programmer laziness | 01/01/70 00:00 | |
WebPage ? | 01/01/70 00:00 | |
Much different | 01/01/70 00:00 | |
And Also | 01/01/70 00:00 | |
Eh ? | 01/01/70 00:00 | |
C and C++ | 01/01/70 00:00 | |
Portable? | 01/01/70 00:00 | |
handle your microprocessor functi | 01/01/70 00:00 | |
Hm, | 01/01/70 00:00 | |
Keil does it | 01/01/70 00:00 | |
Floating point | 01/01/70 00:00 | |
Thanks, | 01/01/70 00:00 |