From Modula-2 Reloaded

WiP: Type UNSIGNED

Type UNSIGNED

Type UNSIGNED would be an unsigned integer type large enough to hold any value in the range 0 to 215 and any value of type SYSTEM.WORD whichever is larger. Types CARDINAL and LONGCARD would become subsets of INTEGER and LONGINT respectively and they could then be library defined types.

The type would be defined as:

TMIN(UNSIGNED) = 0
TMAX(UNSIGNED) = pow(2, TSIZE(UNSIGNED) * 8)
TSIZE(UNSIGNED) >= MAX(TSIZE(OCTET) * 2, TSIZE(WORD))

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