17.1 Standard and Non-Standard Numeric Types

The numeric types encountered thus far--CARDINAL, INTEGER, REAL, and LONGREAL can be counted on to be available in all versions of Modula-2, whether they follow the ISO standard or not. Many non-standard versions will have either SHORT or LONG (or both) forms of INTEGER and CARDINAL and some, to accommodate the idiosyncrasies of the underlying system, will have a variety of REAL types. If the version is ISO standard, any of these additional types will have to be imported from SYSTEM.

There are additional numeric types in common use. These include complex numbers, and (binary coded) decimal numbers. The purpose of this section is to elaborate on the support for and the use of these two types. In the process, there will be some discussion of the formatting of output, and that will be followed up on in connection with the output formatting of items of other number types as well.