C 和 Objective-C:使用 Float64 和 long 有什么区别?
在 C 和 Objective-C 中,使用 Float64 和 long 之间有什么区别?
What's the difference, in C and Objective-C, between using Float64 and long?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
long
是整数(无小数);Float64
(或double
)是浮点型。long
is integral (no decimals);Float64
(ordouble
) is floating-point.Long 是一种整数格式,通常在 64 位上,但取决于平台。 Float64 是一种浮点格式,在 64its(通常是 double)上编写,但保证是在 64 位上。
Long is an integral format, usually on 64bits, but platform-dependant. Float64 is a floating point format, written on 64its (usually double), but guaranteed to be on 64bits.
就像之前提到的,一个是整数,一个是浮点数。基本区别是具有小数点的能力,实数/浮点可以具有而整数不能具有。如果所有条件都相等,则浮点数将以科学记数法存储,而整数则不然。浮点数允许更大的数字并且不需要无符号。 double 是长浮点数,long 是长整型,因此它们是较大的值。同样在 ANSI C 中没有 Float64。
Like mention before one is a integer and one is a float. The basic difference is the ability to have a decimal point, which a real/float can have and integer can not have. If all things were equal a float is stored in science notation, while an integer is not. A float would allow for a much much bigger number and has no need for being unsigned. A double is a long float, and long is long integer so they are larger values. Also in ANSI C there is no Float64.
Float64是浮点数,long是整数。
Float64 is a floating point number, and long is integral.