C语言 “long long”是一种什么样的数据类型?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2127473/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What kind of data type is "long long"?
提问by openfrog
I don't know this type. Is that the biggest one from all? I think it is an integer type, right? Or is it a floating point thing? Bigger than double?
我不知道这种类型。这是最大的一个吗?我认为它是整数类型,对吗?或者它是一个浮点数?比两倍还大?
回答by mloskot
According to C99standard, long longis an integer type which is at least 64-bit wide. There are two integer 64-bit types specified: long long intand unsigned long long int
根据C99标准,long long是至少 64 位宽的整数类型。指定了两种 64 位整数类型:long long int和unsigned long long int
So, yes, this is the biggest integer type specified by C language standard (C99 version).
所以,没错,这是C语言标准(C99版本)规定的最大整数类型。
There is also long doubletype specified by C99. It's an extended precision floating point numeric data type long for 80-bits on most popular x86-based platforms and implementations of C language.
还有C99 指定的long double类型。它是最流行的基于 x86 的平台和 C 语言实现上的 80 位长精度浮点数字数据类型。
回答by hurricaneMitch
The short and simple is that a long longis an intthat is at least 64 bits wide. The rationale for this is here. Basically, it is a response to 64 bit architecture and backwards compatibility. And the name long longwas deemed the least badof all possibilities by the standards committee.
简而言之, along long是int至少 64 位宽的 a 。原因在这里。基本上,它是对 64 位架构和向后兼容性的响应。标准委员会long long认为这个名字是所有可能性中最不坏的。

