[Data Types]
描述
Long variables are extended size variables for number storage, and store 32 bits (4 bytes), from -2,147,483,648 to 2,147,483,647.
If doing math with integers, at least one of the numbers must be followed by an L, forcing it to be a long. See the Integer Constants page for details.
語法
long var = val;
參數
var
: variable name.val
: the value assigned to the variable.
範例程式碼
long speedOfLight_km_s = 300000L; // see the Integer Constants page for explanation of the 'L'
參考
- [程式語法] byte
- [程式語法] int
- [程式語法] unsigned int
- [程式語法] unsigned long
- [程式語法] Integer Constants
- [Language] Variable Declaration
語法參考主頁面
86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。