Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Division in Draft Standard Text, V02.1



Michel Hack wrote:
I agree with Jürgen's suggestion that there should be an easy way to
obtain the two disjoint intervals resulting from complete division by
an interval containing zero.  Here is a possibility:

    Divp(xx, yy)  =def  Div(xx, (yy Intersect [0, +oo]))
    Divn(xx, yy)  =def  Div(xx, (yy Intersect [-oo, 0]))

A compiler may recognise when both are used near each other for the
same arguments, and perform a single division, just as compilers tend
to recognize joint use of div (/) and rem (%) integer operations.

This is a useful way of presenting the solution set of division.
The Vienna proposal gives another option in Section 5.7:

5.7. Division with gap
There is an operation divisionWithGap(xx,yy) that returns for any two
intervals xx=[l,u] and yy=[l’,u’] the interval zz=divideHull(xx,yy)
(see Section 3.11) and the gap gg, which is
- Empty if xx contains 0 or yy does not contain 0,
- Entire if xx or yy is Empty, and
- otherwise the widest subinterval whose interior cannot be
realized as quotient x/y with x in xx, y in yy.
Remarks.
1. In a program, division with gaps must always be called as a
function, whereas ordinary division (divideHull) will usually
be called by overloading.
2. Similarly, one may provide perhaps implementations of inverse
with gap, atan2 with gap, and inverse trigonometric or hyperbolic
functions with gaps.


Arnold Neumaier