LF Fortran 95

DIGITS Function

Description

The DIGITS function returns the number of significant binary digits in a real or integer data object.

Syntax

DIGITS (x)

Arguments

x is an INTENT(IN) scalar or array of type INTEGER or REAL.

Result

The result is of type default INTEGER. Its value is the number of binary digits composing the significant value of x.

Example

real :: r real(kind(1.d0)) :: d integer :: i write(*,*) digits(i),digits(r),digits(d)