[M3devel] INTEGER

hendrik at topoi.pooq.com hendrik at topoi.pooq.com
Thu Apr 22 14:38:06 CEST 2010


On Thu, Apr 22, 2010 at 11:57:16AM -0400, Tony Hosking wrote:
> But this is bizarre.  What type does an element of a subrange of 
> LONGINT have if not LONGINT?

It has LONGINT as a type.

> If the subrange has a base type of INTEGER then we need a mapping 
> between the elements of the subrange and the base INTEGER values.

Yes.  And INTEGER is different from the notion mathematicians have of 
integers in that there is a limit on the size of integers.  It's a 
machine or implementation-dependent limit, and it's imposed for 
efficiency reasons, but it's a specific limit just the same.
This limit is precisely what we're up against.

> But then, values of the LONGINT subrange don't have the same 
> representation as their INTEGER counterpart.

Of course not.  If they did have the same representation, there would be 
in-range for INTEGERs, and there would be no need to have LONGINT at 
all.

LONGINT is there precisely for the integers that *don't* fit in INTEGER.

> 
> All very odd.

But dictated by the intended use -- that of having integral ranges
whose bounds are dictated by the problem, not the hardware.

-- hendrik



More information about the M3devel mailing list