Modula-2 Reloaded ⋄ Type UNSIGNED

Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

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))