The Fortran 90 Standard specifies data representation models
that suggest how data are represented in the computer and how computations
are performed on the data. The computations performed by some Fortran
90 intrinsic functions are described in terms of these models.
There are three data representation models in Fortran 90:
In any given implementation, the model parameters are chosen
to match the implementation as closely as possible. However, an
exact match is not required, and the model does not impose any particular
arithmetic on the implementation.
The Bit Model |
 |
The bit model interprets a nonnegative scalar data object
a of type integer as a sequence of binary
digits (bits), based upon the model:
where n is the number of bits,
given by the intrinsic function BIT_SIZE
and each b has
a bit value of 0 or 1. The bits are numbered from right to left
beginning with 0.
The Integer Number System Model |
 |
The integer number system is modeled by:
where
- i
is the integer value.
- s
is the sign (+1 or -1).
- r
is the radix given by the intrinsic function RADIX
(always 2 for HP systems).
- q
is the number of digits (integer greater than 0),
given by the intrinsic function DIGITS.
- d
is the kth digit and
is an integer 0 <= d<
r. The digits are numbered left to right,
beginning with 1.
The Real Number System Model |
 |
The real number system is modeled by:
where
- x
is the real value.
- s
is the sign (+1 or -1).
- b
is the base (real radix) and is an integer greater
than 1, given by the intrinsic function RADIX
(always 2 for HP systems).
- e
is an integer between some minimum value (lmin)
and maximum value (lmax), given by the
intrinsic functions MINEXPONENT
and MAXEXPONENT.
- p
is the number of mantissa digits and is an integer
greater than 1, given by the intrinsic function DIGITS.
- fk
is the kth digit and
is an integer 0 <= fk
< b, but f1
may be zero only if all the fk
are zero. The digits are numbered left to right, beginning with
1.