Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran 90 Programmer's Reference: HP Fortran 90 Programmer's Reference > Chapter 11 Intrinsic procedures

Data representation models

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

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.

Data representation model intrinsics

Several intrinsic functions provide information about the three data representation models. These intrinsics are listed in Table 11-1 “Intrinsic functions and data representation models”.

Table 11-1 Intrinsic functions and data representation models

Intrinsic function

Description

“BIT_SIZE(I)”

Number of bits in an integer of the kind of I (I is an object, not a kind number)

“DIGITS(X)”

Base digits of precision in integer or real model for X

“EPSILON(X)”

Small value compared to 1 in real model for X

“EXPONENT(X)”

Real model exponent value for X

“FRACTION(X)”

Real model fraction value for X

“HUGE(X)”

Largest model number in integer or real model for X

“MAXEXPONENT(X)”

Maximum exponent value in real model for X

“MINEXPONENT(X)”

Minimum exponent value in real model for X

“NEAREST(X, S)”

Nearest processor real value

“PRECISION(X)”

Decimal precision in real model for X

“RADIX(X)”

Base (radix) in integer or real model for X

“RANGE(X) ”

Decimal exponent range in integer or real model for X

“RRSPACING(X)”

1/(relative spacing near X)

“SCALE(X, I)”

X with real model exponent changed by I

“SET_EXPONENT(X, I)”

Set the real model exponent of X to I

“SPACING(X)”

Absolute spacing near X

“TINY(X)”

Smallest number in real model for X

 

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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.