Re: int2interval, frac2interval, rat2interval
On Apr 20 2012, Vincent Lefevre wrote:
>
> >Note: in practice, the type can provide infinities, but they should
> >be seen as other values, because infinities cannot be produced in a
> >correct integer expression.
>
> Er, why not? It is as easy to specify and produce integral infinities
> as rational / real / floating-point ones. Not all languages use ISO
> C's aberrant numeric type model.
I agree, but I meant that infinities are not part of math integers
(with an exact arithmetic). For instance, 1/0 as an expression on
integers is undefined. For floating-point arithmetic, there is the
concept of limit, but not in integer arithmetic.
Er, no. Firstly, in mathematics, 1/0 is undefined in the integers,
reals, rationals and complex numbers. It can be added to any of them,
but only at the cost of breaking some of their important properties.
Furthermore, the concept of a limit exists for integers, too, and so
does the completion of the ring Z with two infinities. As far as
computational integers and floating-point goes, either or both can
have signed zeroes, and the problems are almost identical.
Sorry, but there is no mathematical or computational difference.
I think that infinities may be useful in integer types, but only in
order to signal overflows. However overflows would mean that the value
is inexact, while the context here is that i is an exact integer.
Anyway, even if one would want to accept infinities seen as exact
values, int2interval(+oo) and int2interval(-oo) would be similar
to nums2interval(+oo,+oo) and int2interval(-oo,-oo), thus NaI,
as suggested above. So, I don't see any problem with the spec on
possible infinities.
Fine. But EXACTLY the same applies to any of the other variants,
such as real / floating-point.
Regards,
Nick Maclaren.
- References:
- Re: int2interval, frac2interval, rat2interval
- Re: int2interval, frac2interval, rat2interval
- Re: int2interval, frac2interval, rat2interval
- Re: int2interval, frac2interval, rat2interval
- Re: int2interval, frac2interval, rat2interval