1

this Wikipedia article did not address this contingency and i am having trouble finding a definitive IEEE-754 document that addresses this.

1 Answers1

4

The implication of the line

x - x = x + (-x) = +0,   ! (for any finite x, −0 when rounding toward negative)

would seem to be that you should get +0.

  • "or -0 when rounding toward negative." I would take that literally. – Doc Brown May 15 '18 at 03:36
  • the funny thing is, even rounding down, that would imply a non-negative number getting rounded down to a negative number. that seems very weird. – robert bristow-johnson May 16 '18 at 22:13
  • i wonder what the rationale is for this -0 resulting if the rounding mode is set to always rounding down. – robert bristow-johnson May 16 '18 at 22:15
  • @robertbristow-johnson: Usually, it won't be a problem. By far, the most common system that has both +0 and -0 is 1's complement. 1's complement has the interesting characteristic that it always truncates toward zero: it might truncate to +0 or -0, but it always truncates toward zero. 2's complement, on the other hand, always truncates toward -INFINITY, and this can cause problems in certain signal processing algorithms. (You do not want to know how I learned this.) – John R. Strohm Jun 05 '21 at 05:46