SELECTED_LOGICAL_KIND
— Choose logical kind ¶SELECTED_LOGICAL_KIND(BITS)
return the kind value of the smallest
logical type whose storage size in bits is at least BITS. If there
is no such logical kind, SELECTED_LOGICAL_KIND
returns -1.
Fortran 2023 and later
Transformational function
RESULT = SELECTED_LOGICAL_KIND(BITS)
BITS | Shall be a scalar and of type INTEGER . |
program logical_kinds integer, parameter :: k1 = selected_logical_kind(1) integer, parameter :: k40 = selected_logical_kind(40) logical(kind=k1) :: l1 ! At least one bit logical(kind=k40) :: l40 ! At least 40 bits ! What is their actual size? print *, storage_size(l1), storage_size(l40) end program logical_kinds