> Implementation in Interval says
> qinterval(i : R, s : R) : % ==
> [roundDown i, roundUp s]
> I think in Interval we should have "qinterval(i, s) = [i, s]",
> and have a local function that uses "[roundDown i, roundUp s]".
> And choose to use one or the other wisely depending on the situation.
Honestly, when I saw the qinterval implementation in Interval(R) for the
first time, I was a bit puzzled. Why should one ever have to round up or
down if you i and s are given on input and that is the stuff one should
use? I didn't want to touch that stuff, so I left Interval unchanged.
Now looking more closely at what roundUp/roundDown does, I believe the
problem the original author wanted to solve was that we might be in
Float (software floats where the number of bits may change in the course
of the computation). I don't want to invest time to understand the
details now, but as you see in float.spad, the precision is global for
the whole domain.
My guess is, qinterval(i,s) was supposed to return an interval
iv:=qinterval(i,s) such that if i<=x<=s with the precision at creation
time, it should also hold that contains?(iv,x) at any later point in
time when the precision might have changed. I do not currently see where
this can be violated, but I don't even know whether the above condition
is the condition the original author cared about. when roundDown/roundUp
was chosen for qinterval.
Ralf