Go Down

Topic: Don't know this syntax - what does L mean? (Read 550 times) previous topic - next topic

endrew

Feb 28, 2010, 11:30 pm Last Edit: Feb 28, 2010, 11:31 pm by endrew Reason: 1
in this line:

OCR1A=(((angle*(SERVO_AILE_MAX-SERVO_AILE_MIN))/180L)+SERVO_AILE_MIN)*2L;

180L?
2L?

Thanks!

Coding Badly

#1
Feb 28, 2010, 11:36 pm Last Edit: Feb 28, 2010, 11:36 pm by bcook Reason: 1
The L declares the constant is a long-integer.  This forces the compiler to perform the arthimetic using long-integers (32 bit) rather than int-integers (16 bit).  Usually this is done to avoid an overflow.


Go Up