[M3devel] INTEGER
hendrik at topoi.pooq.com
hendrik at topoi.pooq.com
Thu Apr 29 14:43:15 CEST 2010
On Thu, Apr 29, 2010 at 11:07:00AM -0500, Rodney M. Bates wrote:
> Oh, I get it! You are proposing a _mixed_ approach, where the values
> the programmer can designate are of fixed (though possibly nonstatic)
> size (like open arrays) but the intermediate results are of unbounded
> size that re-adapts to hold the actual value each time an operator is
> evaluated, (like BigInteger). And because only intermediate results
> work this way, they can be stack allocated, because intermediate
> results have LIFO lifetimes.
In fact, the sizes of intermediate results can be determined statically,
in theory, at least. An arithmetic operation with subranges as
arguments has at most a finite number of possible argument pairs, and
therefore at mist a finite number of possible results. A finite set of
integers has a maximum and a minimum.
In practices, there might be operations (such as shifts and
exponentiation) for which there bounds are impractical.
-- hendrik
>
> These are quite different approaches to arithmetic. It does seem
> at least a bit strange to mix them in this way.
Keeping track of the maximum sizes statically makes it a little less
strange.
-- hendrik
More information about the M3devel
mailing list