long
描述
Long (长整数) 是一个延伸储存空间的变数型别,它可以储存 32bits (4 bytes) 大小的整数,从 -2,147,483,648 到 2,147,483,647。
如果长整数要和整数做数学运算,必须在整数常数最后面加上 L,强制指定此整数为长整数。其他的细节请见 整数常数 的资料
范例
long speedOfLight = 186000L;
// 详见整数常数页面中 ’L’ 的说明
语法
long var = val;
var
long 型别的变数名称
val
指派给变数的值
See also
- byte
- int
- unsigned int
- unsigned long
- Integer Constants
- Variable Declaration
本页由热血青年 LBU 译自英文版。
The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.