IEEE 754 是由电气电子工程师学会(IEEE)制定的二进制浮点数表示与运算标准,规定了浮点数的格式(如单精度、双精度)、舍入规则、特殊值(如 NaN、±Infinity)、以及异常处理等,用于提升不同硬件与软件平台之间数值计算的一致性。(也常写作 IEEE-754。)
/ˌaɪ iː iː iː ˌsɛvən faɪv fɔːr/
Most modern CPUs follow IEEE 754 for floating-point math.
大多数现代 CPU 在浮点运算上都遵循 IEEE 754 标准。
Because IEEE 754 includes NaN and rounding rules, the same calculation can still produce tiny differences across languages or compilers.
由于 IEEE 754 包含 NaN 与舍入规则,即使同一计算在不同语言或编译器之间仍可能出现细微差异。
“IEEE 754”中的 IEEE 是 Institute of Electrical and Electronics Engineers(电气电子工程师学会)的缩写,754 是该标准的编号。该标准最早于 1985 年发布,之后多次修订(如 2008、2019),逐步补充更多格式与更明确的运算规定。