Manual Reference Pages  - digits (3fortran)

NAME

DIGITS(3) - [NUMERIC MODEL] Significant digits in the numeric model

SYNOPSIS

result = digits(x)

         integer function digits(x)

TYPE(kind=KIND),intent(in) :: x(..)

CHARACTERISTICS

o X an integer or real scalar or array
o The return value is an integer of default kind.

DESCRIPTION

DIGITS(3) 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.

OPTIONS

o X : a value of the type and kind to query

RESULT

The number of significant digits in a variable of the type and kind of X.

EXAMPLES

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_digits

Results:

     >  default integer:          31
     >  default real:             24
     >  default doubleprecision:          53

STANDARD

Fortran 95

SEE ALSO

EPSILON(3), EXPONENT(3), FRACTION(3), HUGE(3), MAXEXPONENT(3), MINEXPONENT(3), NEAREST(3), PRECISION(3), RADIX(3), RANGE(3), RRSPACING(3), SCALE(3), SET_EXPONENT(3), SPACING(3), TINY(3)

fortran-lang intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 digits (3fortran) April 28, 2024
Generated by manServer 1.08 from 0fc7abb8-557a-4001-b64a-a19417248d5e using man macros.