PRECISION(X)

Purpose

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

Class

Inquiry function

Argument Type and Attributes

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

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----------------------------+

IBM Copyright 2003