|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#4
|
|||
|
|||
|
Re: Compiler Help Needed
Quote:
Well, the issue with floats is that this micro does not have a Floating Point Unit. So, while on your PC the FPU would quicky preform any math involving floats, that all has to be emulated in software on this micro. That is bad becuase that emulation is fairly complex and could potentially slow down your program considerably, especially if you use alot of floating point numbers. The concerns about the implicit initializations, is basically that normally on microprocessors, the line int i = 5; may not automatically initalize i = 5. Though that is really a moot point in this case since IFI has a routine that does initalize the variables for us. (in ifi_startup.c for those who haven't seen it.) ----------------------- No, you can't use extern with #define. #define isn't actually a variable, what it means, is before the code is complied (in the pre-processor), the any time the first item after the #define is found, it is replaced with the second. So: #define PI 3.1415926538 int C, R = 3; C= 2*PI*R; Becomes (after the pre-processor, but before the actuall compiler) int C, R = 3; C= 2*3.1415926538*R; So if you just put the #define axelWidth .725 in one header file, that you include everywhere, you can use axelWidth with no other effort. ------------------------------ |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C compiler for 2004 | Tim Skloss | Technical Discussion | 11 | 05-11-2003 22:02 |
| C compiler for 2004 | Tim Skloss | Robotics Education and Curriculum | 2 | 04-11-2003 16:19 |
| The Grand FIRST team.. programmers and others needed | randomperson | Programming | 0 | 31-05-2003 23:46 |
| Weight needed to tilt bridge... | archiver | 2001 | 4 | 23-06-2002 23:43 |
| Inventor 5.0 help needed | Larry Barello | Inventor | 4 | 27-01-2002 10:54 |