将负零加到正零时*应该*得到什么?

what *should* you get when you add minus-zero to plus-zero?

this Wikipedia article 没有解决这个意外事件,我很难找到解决这个问题的权威 IEEE-754 文档。

根据one purported copy of the IEEE 754 (1985) standard

When the sum of two operands with opposite signs (or the difference of two operands with like signs) is exactly zero, the sign of that sum (or difference) shall be + in all rounding modes except round toward –INFINITY, in which mode that sign shall be –. However, x+x = x–(–x) retains the same sign as x even when x is zero.

(第 6.3 节)

这适用于 (+0) + (-0) 的情况,要求结果在大多数舍入模式下为 +0,但在朝向 -INFINITY 模式的舍入中为 -0。