DIGITS(X)

Purpose

Returns the number of significant digits for numbers whose type and kind type parameter are the same as the argument.

Class

Inquiry function

Argument type and attributes

X
An INTENT(IN) INTEGER or REAL. The actual argument corresponding to X can be scalar or array valued.

Result type and attributes

Default integer scalar.

Result value

  • IBM extension begins If X is of type integer, the number of the significant digits of X is:
        type                    bits
    -----------                ------
     integer(1)                    7
     integer(2)                   15
     integer(4)                   31
     integer(8)                   63
  • If X is of type real, the number of significant bits of X is:
       type                    bits
    ----------                ------
    real(4)                      24
    real(8)                      53
    real(16)                    106
IBM extension ends

Examples

IBM extension begins DIGITS (X) = 63, where X is of type integer(8) (see Data representation models). IBM extension ends



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us