Manual Reference Pages  - precision (3fortran)

NAME

PRECISION(3) - [NUMERIC MODEL] Decimal precision of a real kind

SYNOPSIS

result = precision(x)

         integer function precision(x)

TYPE(kind=**),intent(in) :: x

CHARACTERISTICS

o X shall be of type real or complex. It may be a scalar or an array.
o the result is a default integer scalar.

DESCRIPTION

PRECISION(3) returns the decimal precision in the model of the type of X.

OPTIONS

o X : the type and kind of the argument are used to determine which number model to query. The value of the argument is not unused; it may even be undefined.

RESULT

The precision of values of the type and kind of X

EXAMPLES

Sample program:

    program demo_precision
    use,intrinsic :: iso_fortran_env, only : dp=>real64,sp=>real32
    implicit none
    real(kind=sp)    :: x(2)
    complex(kind=dp) :: y

print *, precision(x), range(x) print *, precision(y), range(y)

end program demo_precision

Results:

      >           6          37
      >          15         307

STANDARD

Fortran 95

SEE ALSO

DIGITS(3), EPSILON(3), EXPONENT(3), FRACTION(3), HUGE(3), MAXEXPONENT(3), MINEXPONENT(3), NEAREST(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 precision (3fortran) April 28, 2024
Generated by manServer 1.08 from 09569684-5df4-46fb-851a-44f442c6b04d using man macros.