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
  • sometimes, "reinventing the wheel" has its own merits. you do something that you have not done before. you learn something new. you get the opportunity to think about a problem - could it have been solved better? is this solution the best fitting for my application? So many of your posts read like a drumhead trial, Jack.

Reply
  • sometimes, "reinventing the wheel" has its own merits. you do something that you have not done before. you learn something new. you get the opportunity to think about a problem - could it have been solved better? is this solution the best fitting for my application? So many of your posts read like a drumhead trial, Jack.

Children
  • sometimes, "reinventing the wheel" has its own merits. you do something that you have not done before. you learn something new. you get the opportunity to think about a problem - could it have been solved better?

    Yes, I agree with all that and am not suggesting otherwise.

    is this solution the best fitting for my application?

    This is precisely the message I'm trying to get across - use the best fitting resources to solve the problem in hand. If the advantages of using floating point outweigh the disadvantages then use it. There seems to be a prevailing attitude that certain facilities shouldn't be used merely because the 8051 is not suited to them, without bothering to consider whether it actually matters.

    So many of your posts read like a drumhead trial, Jack.

    I'm glad to hear it.

  • 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.

  • 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.