13.3.4 Integer Values

The standard input rules for converting integer values are quite simple.

gifs/20000000.gif Any leading blanks are skipped.

gifs/20000000.gif Thousands group characters are skipped.

gifs/20000000.gif Any other non-digit character stops translation.

Note that the decimal separator character is not allowed. When converting a number, conversion stops at a decimal separator. If the number is being entered into a C/Base program, the decimal separator is flagged as an error.

After the input string has been scanned, the digits are converted into the binary value. Checks are also made on the magnitude of the number. The actual magnitude allowed depends on the internal size of the field. Two sizes are currently supported: 2 bytes and 4 bytes. These sizes are for short and long integers, respectively. The ranges of legal values is given in the table below.

Size Negative Limit Positive Limit

2 -32768 32767

4 -2147483648 21474836487

For users who have the C/Base Utilities package, these ranges are defined in the include file <cbase/dtypes.h>.