XL Fortran for AIX 8.1

Language Reference


PRECISION(X)

Returns the decimal precision in the model representing real numbers with the same kind type parameter as the argument.

X
must be of type real or complex. It may be scalar or array valued.

Class

Inquiry function

Result Type and Attributes

Default integer scalar.

Result Value

The result is:

INT( (DIGITS(X) - 1) * LOG10(2) )

+-------------------------------IBM Extension--------------------------------+

Therefore,

       Type               Precision
--------------------      ---------
 real(4) , complex(4)           6
 real(8) , complex(8)          15
real(16) , complex(16)         31

+----------------------------End of IBM Extension----------------------------+

+-------------------------------IBM Extension--------------------------------+

Examples

PRECISION (X) = INT( (24 - 1) * LOG10(2.) ) = INT(6.92 ...) = 6 for X of type real(4). See Real Data Model.

+----------------------------End of IBM Extension----------------------------+


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]