[UP]


Manual Reference Pages  - selected_int_kind (3)

NAME

selected_int_kind(3f) - [FORTRAN:INTRINSIC] Choose integer kind

CONTENTS

Syntax
Description
Arguments
Example
Standard
Class

SYNTAX

result = selected_int_kind(r)

DESCRIPTION

selected_int_kind(r) return the kind value of the smallest integer type that can represent all values ranging from -10**R (exclusive) to 10**R (exclusive). If there is no integer kind that accommodates this range, selected_int_kind returns -1.

ARGUMENTS

R - Shall be a scalar and of type INTEGER.

EXAMPLE

Sample program:

   program demo_selected_int_kind
     integer,parameter :: k5 = selected_int_kind(5)
     integer,parameter :: k15 = selected_int_kind(15)
     integer(kind=k5) :: i5
     integer(kind=k15) :: i15

print *, huge(i5), huge(i15)

! the following inequalities are always true print *, huge(i5) >= 10_k5**5-1 print *, huge(i15) >= 10_k15**15-1 end program demo_selected_int_kind

STANDARD

[[Fortran 95]] and later

CLASS

Transformational function


selected_int_kind (3) March 19, 2019
Generated by manServer 1.08 from d2b1a44f-6376-464d-b75d-f853370f9d03 using man macros.