06.03.2014 Views

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

9 <strong>Intel</strong> <strong>Fortran</strong> <strong>Language</strong> <strong>Reference</strong><br />

Example<br />

QREAL ((2.0q0, 3.0q0)) has the value 2.0q0.<br />

RADIX<br />

Description:<br />

Syntax:<br />

Class:<br />

Arguments:<br />

Results:<br />

Returns the base of the model representing numbers of the same type and kind<br />

parameters as the argument.<br />

result = RADIX (x)<br />

Inquiry function; Generic<br />

x must be of type integer or real; it can be scalar or array valued.<br />

The result is a scalar of type default integer. For an integer argument, the result<br />

has the value r (as defined in “Model for Integer Data”). For a real argument,<br />

the result has the value b (as defined in “Model for Real Data”).<br />

Example<br />

If X is a REAL(4) value, RADIX (X) has the value 2.<br />

RAN<br />

Description:<br />

Syntax:<br />

Class:<br />

Arguments:<br />

Results:<br />

Returns the next number from a sequence of pseudorandom numbers of<br />

uniform distribution over the range 0 to 1. This is a specific function that has<br />

no generic function associated with it. It cannot be passed as an actual<br />

argument.<br />

RAN is not a pure function.<br />

result = RAN (i)<br />

Nonelemental function; Specific<br />

i is the seed. It must be an INTEGER(4) variable or array element.<br />

It should initially be set to a large, odd integer value. The RAN function stores<br />

a value in the argument that is later used to calculate the next random number.<br />

There are no restrictions on the seed, although it should be initialized with<br />

different values on separate runs to obtain different random numbers.<br />

The result type is REAL(4). The result is a floating-point number that is<br />

uniformly distributed in the range between 0.0 inclusive and 1.0 exclusive. It is<br />

set equal to the value associated with the argument i.<br />

9-126

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!