Next: Referable Data Types, Up: Types And Values [Index]

There are four proper intrinsic types, the ‘`cardinal`’, ‘`integer`’,
‘`real`’ and ‘`text`’, and one improper ‘`void`’ intrinsic type.

The numerical types have a fixed size representation reflecting the machine
native arithmetic. Typically, the type sizes expressed in bits are 32 or 64.
As machine representations, the numbers are limited in range and precision.
A 32 bit ‘`integer`’ allows values between and including -2,147,483,648 and
2,147,483,647.

Number and string values may be included with the *aime* programs. Such
values are called literals and their type is determined upon their form.

Integer values may be introduced in base 10 when they are represented as
sequences of digits and when they don’t start with a ‘`0`’, in base 8 when
they do start with a ‘`0`’, or base 16 when the hexadigit sequence is
preceded by a ‘`0x`’ mark. Base 8 specification will allow only the
‘`0`’ to ‘`7`’, while the base 16 allows two equivalent set of extra
digits, ‘`a`’ to ‘`f`’ and ‘`A`’ to ‘`F`’.

‘`-`’ and ‘`+`’ signs may not strictly belong with the ‘`integer`’
syntax, and may be interpreted as unary operators.

‘`integer`’ literal may be suffixed by the superfluous ‘`i`’.

‘`integer`’ literal examples:

- 1000
- -66
- 0200 - octal, 128 in base 10
- 0x1000 - hexadecimal, 4096 in decimal
- 0xa - 10 in decimal
- 0xabcdef - 11259375
- 0xDEAD - 57005

Character literals are recognized. Their *aime* type is ‘`integer`’.
Escape sequences are interpreted as for string literals.

Character literal examples:

- ’A’
- ’.’
- ’\”
- ’\n’ - newline
- ’n’

‘`cardinal`’ literals suffix the non ‘`i`’ suffix ‘`integer`’ syntax
with a ‘`z`’.

Examples:

- 8192z
- 0100z - octal, 64 in base 10
- 0x4000z - hexadecimal, 16384 in decimal
- 0xffz - 255 in decimal

A ‘`r`’ suffix marks a ‘`real`’ literal. No suffix is required if a
digit point is included. At least one of the integral and fractional parts
need to be present. Only base 10 is allowed.

‘`real`’ literal examples:

- 2r
- -101r
- 0.5
- -200.123
- -200.0
- .0
- .5
- -.003
- -99.99r
- .00555r

String literals are quoted. Escaping is recognized. The octal and the
‘`'\a'`’, ‘`'\b'`’, ‘`'\f'`’, ‘`'\n'`’, ‘`'\r'`’, ‘`'\t'`’
and ‘`'\v'`’ escape sequences are interpreted.

All characters (bytes) are permitted with the exception of the 0 coded. Intrinsic strings are 0 terminated.

Consequent string constants are interpreted as a single split string constant.

‘`text`’ literal examples:

- "one"
- "fata morgana"
- ">\40<" is "> <" for ASCII encoding
- "123" "456" "789"

Next: Referable Data Types, Up: Types And Values [Index]