long long data type in GCC and what's the meaning of 1LL
2007-01-25 15:47
597 查看
ISO C99 supports data types for integers that are at least 64 bits wide, and as an extension GCC supports them in C89 mode and in C++. Simply write
You can use these types in arithmetic like any other integer types. Addition, subtraction, and bitwise boolean operations on these types are open-coded on all types of machines. Multiplication is open-coded if the machine supports fullword-to-doubleword a widening multiply instruction. Division and shifts are open-coded only on machines that provide special support. The operations that are not open-coded use special library routines that come with GCC.
There may be pitfalls when you use
long long intfor a signed integer, or
unsigned long long intfor an unsigned integer. To make an integer constant of type
long long int, add the suffix `LL' to the integer. To make an integer constant of type
unsigned long long int, add the suffix `ULL' to the integer.
You can use these types in arithmetic like any other integer types. Addition, subtraction, and bitwise boolean operations on these types are open-coded on all types of machines. Multiplication is open-coded if the machine supports fullword-to-doubleword a widening multiply instruction. Division and shifts are open-coded only on machines that provide special support. The operations that are not open-coded use special library routines that come with GCC.
There may be pitfalls when you use
long longtypes for function arguments, unless you declare function prototypes. If a function expects type
intfor its argument, and you pass a value of type
long long int, confusion will result because the caller and the subroutine will disagree about the number of bytes for the argument. Likewise, if the function expects
long long intand you pass
int. The best way to avoid such problems is to use prototypes.
相关文章推荐
- ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 438, event_type: 2
- Android通过setDataAndType(uri, "type")打开文件
- 2 Datatype and variables in VBScript
- Data too long for column 'type' at row 1 Query: insert into news
- What's a Document Type Definition (DTD) and ...
- [iOS]将含有NSData数据的数组转化为json字符串报错:reason: 'Invalid type in JSON write (NSConcreteMutableData)
- Simplified and Extended Data Binding Syntax in ASP.NET 2.0 -- Cont'd
- Scripting <path> data in SVG (reading and modifying)
- Find data in your SAP system and know which tables do what
- ADO.NET Entity Framework: The version of SQL Server in use does not support datatype 'datetime2'
- What is the Difference Between Type and Class in
- gcc 4.3.2 编译时 发生 error: redeclaration of C++ built-in type 'bool' 错误
- 海洋工作室——网站建设专家:The version of SQL Server in use does not support datatype datetime2 and the Entity Framework.
- The Relation between `skb->len' and `skb->data_len' and What They Represent
- Weka报错"Unknow data type INT. Add entry in weka/experiment/DatabaseUtils.props"
- Spatial data in sql and draw boundary on bing maps
- What is a "sosreport" and how do I create it in Red Hat Enterprise Linux 4.6 and later
- SQL Server error "Xml data type is not supported in distributed queries" and workaround for it
- GCC出现warning: integer constant is too large for 'long' type"
- [原创]What is "Type" in managed heap?