32位和64位操作系统中的双字节大小 [英] The Double Byte Size in 32 bit and 64 bit OS

查看:406
本文介绍了32位和64位操作系统中的双字节大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行时, double 大小有差异我的应用程序在32和64位环境?

Is there a difference in double size when I run my app on 32 and 64 bit environment?

如果我没有错误,在32位环境中的双倍将在0之后占用16位数,而64位中的双位将占用32位,我是对吗?

If I am not mistaken the double in 32 bit environment will take up 16 digits after 0, whereas the double in 64 bit will take up 32 bit, am I right?

推荐答案

不, IEEE 754双精度浮点数总是64位。类似地,单精度 float 总是32位。

No, an IEEE 754 double-precision floating point number is always 64 bits. Similarly, a single-precision float is always 32 bits.

如果您的问题是关于C#和/或。 NET(如您的标签所示),所有的数据类型大小是固定的,与您的系统架构无关。这与Java相同,但与C和C ++不同,其中类型大小因平台而异。

If your question is about C# and/or .NET specifically (as your tag would indicate), all of the data type sizes are fixed, independent of your system architecture. This is the same as Java, but different from C and C++ where type sizes do vary from platform to platform.

通常,整数类型具有不同的大小C和C ++中的不同体系结构。例如, int 在16位DOS为16位宽,Win32为32位宽。然而,IEEE 754标准对于浮点计算是如此无所不在,大小为$ code> float 和 double do 在现实世界中可以找到的任何系统都有所不同 - 20年前 double 是64位,所以今天是。

It is common for the integral types to have different sizes on different architectures in C and C++. For instance, int was 16 bits wide in 16-bit DOS and 32 bits wide in Win32. However, the IEEE 754 standard is so ubiquitous for floating-point computation that the sizes of float and double do not vary on any system you will find in the real world--20 years ago double was 64 bits and so it is today.

这篇关于32位和64位操作系统中的双字节大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆