## 9.2. Primitive constant constructors

Integer constants are constructed using make_int:

* v*: VARIETY
* value*: SIGNED_NAT
-> EXP INTEGER(*v*)

The SIGNED_NAT *value* is an encoding of the binary value required
for the integer; this value must lie within the limits given by *v*.
I have been rather slip-shod in writing down examples of integer constants
earlier in this document; where I have written 1 as an integer EXP,
for example, I should have written make_int(v, 1) where v is some
appropriate VARIETY.
Constants for both floats and strings use STRINGs. A constant string
is just an particular example of make_nof_int:

* v*: VARIETY
* str*: STRING(*k, n*)
-> EXP NOF(*n*, INTEGER(*v*))

Each unsigned integer in *str* must lie in the variety *v*
and the result is the constant array whose elements are the integers
considered to be of VARIETY *v*. An ASCI-C constant string might
have *v* = variety(-128,127) and *k* = 7; however, make_nof_int
can be used to make strings of any INTEGER VARIETY; a the elements
of a Unicode string would be integers of size 16 bits.
A floating constant uses a STRING which contains the ASCI characters
of a expansion of the number to some base in make_floating:

* f*: FLOATING_VARIETY
* rm*: ROUNDING_MODE
* sign*: BOOL
* mantissa*: STRING(*k, n*)
* base*: NAT
* exponent*: SIGNED_NAT
-> EXP FLOATING(*f*)

For a normal floating point number, each integer in *mantissa*
is either the ASCI `.'-symbol or the ASCI representation of a digit
of the representation in the given *base*; i.e. if c is the ASCI
symbol, the digit value is c-'0'. The resulting floating point number
has SHAPE FLOATING(f) and value *mantissa* ** base** exponent*
rounded according to *rm*. Usually the base will be 10 (sometimes
2) and the rounding mode to_nearest. Any floating-point evaluation
of expressions done at translate-time will be done to an accuracy
greater that implied by the FLOATING_VARIETY involved, so that floating
constants will be as accurate as the platform permits.
The make_floating construct does not apply apply to a complex FLOATING_VARIETY
*f*; to construct a complex constant use make_complex with two
make_floating arguments.

Constants are also provided to give unique null values for pointers,
label values and procs i.e.: make_null_ptr, make_null_local_lv and
make_null_proc. Any significant use of these values (e.g. taking the
contents of a null pointer) is undefined, but they can be assigned
and used in tests in the normal way.