This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C

I was hoping to find on-line manuals that I could print and read on the john. So far no luck. But what I really need is how to declare variables in C.

For example, I have a sample code that has the statement:

unsigned char

and

unsigned long

What do these mean and do they limit the declaration to integers. What do i declare if I want a floating point?

Also, someone told me I cant do floating point with a Keil Compiler because of licensing issues (I got my copy from Silicon Labs and have just registered it). I will eventually need to do trig functions. What do i have to get (buy) to complete my project?

Parents
  • This is precisely the message I'm trying to get across - use the best fitting resources to solve the problem in hand.

    At the same time, you're keeping completely quiet about the other message - that the most convenient approach (or even the only approach the programmer knows) may not work in practice.

    If the advantages of using floating point outweigh the disadvantages then use it.

    Someone who is not aware of alternative approaches to a problem has no way of gauging the advantages or disadvantages of the one approach they know about.

Reply
  • This is precisely the message I'm trying to get across - use the best fitting resources to solve the problem in hand.

    At the same time, you're keeping completely quiet about the other message - that the most convenient approach (or even the only approach the programmer knows) may not work in practice.

    If the advantages of using floating point outweigh the disadvantages then use it.

    Someone who is not aware of alternative approaches to a problem has no way of gauging the advantages or disadvantages of the one approach they know about.

Children
  • At the same time, you're keeping completely quiet about the other message - that the most convenient approach (or even the only approach the programmer knows) may not work in practice.

    I advised using the 'best fitting resources' - they would hardly be the best fit if they didn't work for the task in hand.

    Someone who is not aware of alternative approaches to a problem has no way of gauging the advantages or disadvantages of the one approach they know about.

    Yes, I agree.

  • I think that's the key issue - especially with the 8051.

    Because there is a 'C' compiler, newcomers don't even realise that certain features of "normal" 'C' are really not good for an 8051.

    Floating point is one of the commonest, and it is generally the case that people have not even considered that there might be any issues - let alone evaluated those issues and come to the conclusion that floating point (or whatever) is "good enough" even so.