From Modula-2 Reloaded

WiP: Type SIZEINT

Type SIZEINT

Type SIZEINT would be a signed integer type that can hold values in the range -1 to the size of the largest allocatable storage area measured in octets. The type would map to POSIX' ssize_t type. Functions SIZE, TSIZE, HIGH and LENGTH would then return values of type SIZEINT. The size parameters of ALLOCATE and DEALLOCATE would be of type SIZEINT.

The type would be defined as:

TMIN(SIZEINT) = -1
TMAX(SIZEINT) = pow(2, (TSIZE(SIZEINT) * 8) DIV 2)
TSIZE(SIZEINT) >= (TSIZE(ADDRESS) DIV 8) - 1

Retrieved from http://modula-2.net/m2r10/pmwiki.php?n=WiP.TypeSIZEINT
Page last modified on 2010-03-21 16:48