# 双精度浮点格式

**双精度浮点格式**（Double-precision floating-point format）是一种64位计算机数字格式，在IEEE 754标准中规范为binary64，它将实数存储为1个符号位、11位偏置指数和52位尾数，由此获得53位有效数精度，约合15至17位有效十进制数字，指数范围为-1022至+1023。<sup>[1](https://docs.oracle.com/cd/E37069_01/html/E39019/z4000ac019269.html)</sup><sup> • </sup><sup>[2](https://dlmf.nist.gov/3.1)</sup> 它是C和C++（`double`）、Java、Python、JavaScript以及大多数科学软件中默认的实数类型。<sup>[3](https://docs.python.org/3.11/tutorial/floatingpoint.html?highlight=floating)</sup><sup> • </sup><sup>[4](https://docs.oracle.com/javase/specs/jls/se7/jls7.pdf?from=20423&from_column=20423)</sup>

| 关键事实 | 详情 |
|---|---|
| 位布局 | 1个符号位、11位偏置指数、52位尾数；隐含的前导有效数位使规格数的精度达到53位<sup>[1](https://docs.oracle.com/cd/E37069_01/html/E39019/z4000ac019269.html)</sup> |
| 指数范围 | \( E_{\min} = -1022 \)，\( E_{\max} = 1023 \)；机器精度 \( 2^{-53} \approx 0.111 \times 10^{-15} \)<sup>[2](https://dlmf.nist.gov/3.1)</sup> |
| 最大有限值 | 1.7976931348623157e+308<sup>[5](https://docs.oracle.com/cd/B14117_01/appdev.101/b10795/adfns_ty.htm)</sup> |
| 最小正值 | 规格数：2.2250738585072014e-308；次正规数：4.9406564584124654e-324<sup>[5](https://docs.oracle.com/cd/B14117_01/appdev.101/b10795/adfns_ty.htm)</sup> |
| 十进制精度 | 15至17位有效十进制数字<sup>[5](https://docs.oracle.com/cd/B14117_01/appdev.101/b10795/adfns_ty.htm)</sup> |
| 标准 | 在IEEE 754-1985中定义为“双精度格式”；2008年和2019年修订版以binary64之名沿用<sup>[6](https://standards.ieee.org/ieee/754/993/)</sup><sup> • </sup><sup>[2](https://dlmf.nist.gov/3.1)</sup> |
| 普及程度 | Python的float、JavaScript的`Number`和Java的`double`均映射为binary64<sup>[3](https://docs.python.org/3.11/tutorial/floatingpoint.html?highlight=floating)</sup><sup> • </sup><sup>[7](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Numbers_and_strings)</sup> |

## 位布局与数值

64个比特分为三个字段。第0至51位存储52位尾数 \( f \)，第52至62位存储11位偏置指数 \( e \)，第63位存储符号位 \( s \)。<sup>[1](https://docs.oracle.com/cd/E37069_01/html/E39019/z4000ac019269.html)</sup> 对于规格数，当 \( 0 < e < 2047 \) 时，其数值为

\[ (-1)^{s} \times 2^{e-1023} \times 1.f \]

二进制小数点前的前导1并不存储，而是由非零偏置指数隐含，这正是52个存储尾数位能提供53位精度的原因。<sup>[1](https://docs.oracle.com/cd/E37069_01/html/E39019/z4000ac019269.html)</sup> 偏置值1023意味着规格数的存储指数字段从1到2046，对应有效指数从-1022到+1023。<sup>[2](https://dlmf.nist.gov/3.1)</sup>

**特殊模式。** 保留的指数值用于编码特殊值：\( e = 0 \) 且 \( f = 0 \) 表示带符号零，\( e = 0 \) 且 \( f \neq 0 \) 表示次正规数，\( e = 2047 \) 且 \( f = 0 \) 表示正无穷或负无穷，\( e = 2047 \) 且 \( f \neq 0 \) 表示NaN（非数），用于指示无效运算，例如负数的平方根。<sup>[1](https://docs.oracle.com/cd/E37069_01/html/E39019/z4000ac019269.html)</sup> 该标准将正零和负零视为不同的位模式。<sup>[5](https://docs.oracle.com/cd/B14117_01/appdev.101/b10795/adfns_ty.htm)</sup>

## 范围与精度

最大有限值为 \( (2 - 2^{-52}) \times 2^{1023} \)，十进制写作1.7976931348623157e+308；最小正规格数为 \( 2^{-1022} \)，约为2.2250738585072014e-308。<sup>[8](https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Double.html)</sup><sup> • </sup><sup>[5](https://docs.oracle.com/cd/B14117_01/appdev.101/b10795/adfns_ty.htm)</sup> 次正规数的前导有效数位为0，将可表示范围扩展到最小规格数以下：52位尾数实际上将最小指数从10^-308延伸到10^-324，最小正值为 \( 2^{-1074} \)，约为4.9e-324。<sup>[9](https://oracle.hydrogen.sagittarius.connect.product.adaptavist.com/cd/E60778_01/html/E60763/z4000ac020351.html)</sup><sup> • </sup><sup>[8](https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Double.html)</sup> 次正规结果不具备与规格数相同的相对舍入误差界，因为次正规值越小，其尾数中的非零位就越少。<sup>[9](https://oracle.hydrogen.sagittarius.connect.product.adaptavist.com/cd/E60778_01/html/E60763/z4000ac020351.html)</sup>

精度通常表述为15至17位有效十进制数字。<sup>[5](https://docs.oracle.com/cd/B14117_01/appdev.101/b10795/adfns_ty.htm)</sup> 机器精度即1与大于1的下一个可表示数之间间距的一半，为 \( 2^{-53} \approx 0.111 \times 10^{-15} \)，而单精度binary32为 \( 0.596 \times 10^{-7} \)。<sup>[2](https://dlmf.nist.gov/3.1)</sup> 53位有效数的一个推论是，绝对值不超过 \( 2^{53} - 1 \) 的整数均可精确表示；超出此范围后，相邻整数开始共享表示。<sup>[7](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Numbers_and_strings)</sup>

## 舍入与算术

由于大多数实数无法用53位精确表示，每次算术运算都会将结果舍入到最近的可表示值。IEEE 754标准定义了五种舍入模式；默认模式为就近舍入、逢半取偶，可最大限度减少长计算中的统计偏差。<sup>[10](https://technav.ieee.org/topic/floating-point-arithmetic/)</sup> 该标准还要求加法、减法、乘法、除法和平方根必须正确舍入，因此结果由输入、运算顺序和目标格式唯一确定。<sup>[10](https://technav.ieee.org/topic/floating-point-arithmetic/)</sup>

舍入使算术运算不满足结合律：\( (a + b) + c \) 与 \( a + (b + c) \) 可能因微小的舍入误差而不同，当并行硬件改变运算顺序时，这一点尤为重要。<sup>[11](https://docs.nvidia.com/cuda/archive/9.2/cuda-c-best-practices-guide/index.html)</sup> 累积舍入误差是浮点计算的典型特征，保护位、补偿求和和更高精度中间值等技术可用于控制它。<sup>[12](https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html)</sup>

## 实际中的表示误差

大多数十进制小数无法精确表示为二进制小数。十进制值0.1是无限循环二进制小数0.0001100110011...，因此任何有限存储都只能保存近似值。在binary64中，存储值为分数3602879701896397 / 2^55，其精确十进制展开为0.1000000000000000055511151231257827021181583404541015625。<sup>[3](https://docs.python.org/3.11/tutorial/floatingpoint.html?highlight=floating)</sup> 各语言通常显示舍入后的形式，因此这种近似在算术暴露它之前不可见：在Python中，`0.1 + 0.1 + 0.1 == 0.3` 的求值结果为False。<sup>[3](https://docs.python.org/3.11/tutorial/floatingpoint.html?highlight=floating)</sup> 这种行为是二进制浮点固有的，出现在每一种使用硬件算术的语言中，并非某一实现的缺陷。<sup>[3](https://docs.python.org/3.11/tutorial/floatingpoint.html?highlight=floating)</sup>

因此，需要精确十进制算术的应用（如货币处理）会改用十进制或整数类型；例如，Oracle数据库在需要十进制舍入时推荐使用其十进制`NUMBER`类型，同时提供`BINARY_DOUBLE`以获得原生binary64速度。<sup>[13](https://docs.oracle.com/en/database/oracle/oracle-database/21/adfns/sql-data-types.html?source=%3Aex%3Anc%3A%3A%3Arc%5Fwwmk180119p00044%3Astartupblog)</sup>

## 历史与标准化

该格式源自1985年批准的IEEE 754-1985标准《IEEE二进制浮点算术标准》，该标准规定了基本和扩展二进制格式、算术运算、转换和异常处理。<sup>[6](https://standards.ieee.org/ieee/754/993/)</sup> 该标准源于20世纪70年代中期开始的工作：当时英特尔聘请了加州大学伯克利分校的数值分析学家威廉·卡汉（William Kahan），他曾记录过不一致的浮点设计造成的损害，协助为8087协处理器设计算术；伯克利起草的提案最终成为IEEE标准。<sup>[14](https://ethw.org/Milestones%3AIEEE%5FStandard%5F754%5Ffor%5FBinary%5FFloating-Point%5FArithmetic%2C%5F1985)</sup> 2008年修订版重新命名了各格式，将64位格式定名为binary64，并增加了十进制算术；2019年修订版是一次小幅更新，该标准以ISO/IEC/IEEE 60559之名被国际采用。<sup>[2](https://dlmf.nist.gov/3.1)</sup><sup> • </sup><sup>[15](https://standards.ieee.org/ieee/754/6210/)</sup>

## 以binary64为默认格式的场景

若干广泛使用的环境将其整个数值模型建立在binary64之上。Python在几乎所有平台上将其`float`类型映射为IEEE 754 binary64。<sup>[3](https://docs.python.org/3.11/tutorial/floatingpoint.html?highlight=floating)</sup> JavaScript的`Number`类型即binary64，因此每个数字字面量，无论整数还是小数，都是双精度数；ECMAScript规范将Number类型定义为IEEE 754-2019 binary64值，并将标准中不同的NaN模式归并为单一NaN。<sup>[7](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Numbers_and_strings)</sup><sup> • </sup><sup>[16](https://tc39.es/ecma262/pr/3752/)</sup> Java的`double`和`float`分别对应binary64和binary32。<sup>[4](https://docs.oracle.com/javase/specs/jls/se7/jls7.pdf?from=20423&from_column=20423)</sup> JSON数据格式将binary64列为互操作性基线，并指出 \( [-(2^{53})+1,\ (2^{53})-1] \) 范围内的整数可在各实现之间精确交换。<sup>[17](https://www.rfc-editor.org/info/rfc8259/)</sup>

在GPU上，硬件双精度随英伟达计算能力1.3及更高版本到来。<sup>[18](https://developer.nvidia.com/cuda/faq)</sup> GPU上的双精度吞吐量增长远慢于低精度吞吐量：2016年至2025年间，英伟达GPU上的FP16性能增长超过100倍，而FP64性能增长7.5倍；在精度允许时以单精度或半精度替代的混合精度方法，在计算密集型工作负载中可达双精度吞吐量的8倍。<sup>[19](https://link.springer.com/article/10.1007/s11227-026-08264-4)</sup> 双精度仍是科学模拟的默认选择，但对引力透镜建模等应用的研究发现，单精度，或仅在误差要求时使用双精度的混合精度算法，可以在足够准确的同时带来大幅加速。<sup>[20](https://arxiv.org/abs/1902.03252)</sup>

## References

1. [Double Format, Oracle Solar Studio 12.4 Numerical Computation Guide](https://docs.oracle.com/cd/E37069_01/html/E39019/z4000ac019269.html)
2. [DLMF §3.1 Arithmetics and Error Measures, NIST](https://dlmf.nist.gov/3.1)
3. [Floating Point Arithmetic: Issues and Limitations, Python documentation](https://docs.python.org/3.11/tutorial/floatingpoint.html?highlight=floating)
4. [The Java Language Specification, SE 7, §3.10 Literals](https://docs.oracle.com/javase/specs/jls/se7/jls7.pdf?from=20423&from_column=20423)
5. [Selecting a Datatype, Oracle Database 10g Application Developer's Guide](https://docs.oracle.com/cd/B14117_01/appdev.101/b10795/adfns_ty.htm)
6. [IEEE 754-1985, IEEE Standards Association](https://standards.ieee.org/ieee/754/993/)
7. [Numbers and strings, JavaScript Guide, MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Numbers_and_strings)
8. [Class Double, Java SE 15 API documentation](https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Double.html)
9. [Underflow, Oracle Developer Studio 12.5 Numerical Computation Guide](https://oracle.hydrogen.sagittarius.connect.product.adaptavist.com/cd/E60778_01/html/E60763/z4000ac020351.html)
10. [Floating-point arithmetic, IEEE Technology Navigator](https://technav.ieee.org/topic/floating-point-arithmetic/)
11. [CUDA C Best Practices Guide, NVIDIA](https://docs.nvidia.com/cuda/archive/9.2/cuda-c-best-practices-guide/index.html)
12. [David Goldberg, What Every Computer Scientist Should Know About Floating-Point Arithmetic, ACM Computing Surveys 23(1), 1991](https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html)
13. [Using SQL Data Types in Database Applications, Oracle Database 21c](https://docs.oracle.com/en/database/oracle/oracle-database/21/adfns/sql-data-types.html?source=%3Aex%3Anc%3A%3A%3Arc%5Fwwmk180119p00044%3Astartupblog)
14. [Milestones: IEEE Standard 754 for Binary Floating-Point Arithmetic, 1985, Engineering and Technology History Wiki](https://ethw.org/Milestones%3AIEEE%5FStandard%5F754%5Ffor%5FBinary%5FFloating-Point%5FArithmetic%2C%5F1985)
15. [IEEE 754-2019, IEEE Standards Association](https://standards.ieee.org/ieee/754/6210/)
16. [ECMAScript Language Specification (draft)](https://tc39.es/ecma262/pr/3752/)
17. [RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format](https://www.rfc-editor.org/info/rfc8259/)
18. [CUDA FAQ, NVIDIA Developer](https://developer.nvidia.com/cuda/faq)
19. [Mixed-precision numerics in scientific applications: survey and perspectives, The Journal of Supercomputing](https://link.springer.com/article/10.1007/s11227-026-08264-4)
20. [High Performance Computing for gravitational lens modeling: single vs double precision on GPUs and CPUs, arXiv](https://arxiv.org/abs/1902.03252)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Arithmetic and number systems › Computational arithmetic › Floating-point and mixed-precision arithmetic

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/double-precision-floating-point-format

English original: https://www.edgepedia.org/double-precision-floating-point-format
