digits(3f) - [FORTRAN:INTRINSIC:NUMERIC MODEL] Significant digits function
result = digits(x)
digits(x) returns the number of significant digits of the internal model representation of X. For example, on a system using a 32-bit floating point representation, a default real number would likely return 24.
X The type may be INTEGER or REAL.
The return value is of type INTEGER.
Sample program:
program demo_digits implicit none integer :: i = 12345 real :: x = 3.143 doubleprecision :: y = 2.33d0 print *,default integer: , digits(i) print *,default real: , digits(x) print *,default doubleprecision:, digits(y) end program demo_digitsTypical Results:
default integer: 31 default real: 24 default doubleprecision: 53
[[Fortran 95]] and later
[[Inquiry function]]
digits (3) | March 11, 2021 |