ABSTRACT

Suppose u is the unum representing [-1, 2). Here is why we should not simply use u⊗u to find the square of u. The square should be [0, 4], but a mindless multiplication lacks the information that the two values are the same variable, and produces the looser (albeit correct) bound (-2, 4]: Moduleu = g2u -1 2closed open , view[u ⊗ u](–2, 4)

Squaring a number should never produce any negative numbers, but that is what the multiply routine will produce since it incorrectly assumes its input values are independent. So the code for squaring needs to watch for ranges that straddle zero. In a well-made unum environment, writing “x⊗x” should trigger an error and a question to the user, “Did you mean to square x?”