Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: [1]   Go Down
Author Topic: Don't know this syntax - what does L mean?  (Read 532 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

in this line:

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

180L?
2L?

Thanks!
« Last Edit: February 28, 2010, 05:31:32 pm by endrew » Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 216
Posts: 13140
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 28, 2010, 05:36:30 pm by bcook » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks!
Logged

Pages: [1]   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: