To: J3 J3/19-147r1 From: Van Snyder & Dan Nagle Subject: SELECTED_LOGICAL_KIND Date: 2019-February-13 Introduction ============ During discussion of 19-139, it was decided that a useful companion feature to providing names of several constants that are kind type parameter values for type LOGICAL in ISO_FORTRAN_ENV, is a SELECTED_LOGICAL_KIND intrinsic function. Proposal ======== Provide a SELECTED_LOGICAL_KIND intrinsic function with an integer argument that specifies the minimum number of bits the representation for a kind of logical data objects, and returns either a value of a kind type parameter for logical type that represents logical values using the smallest number of bits greater than or equal to that value, or -1 if there is no such representation. Edits ===== [413:22+ after 16.9.169 SELECTED_INT_KIND] Insert a new subclause: " 16.9.169+ SELECTED_LOGICAL_KIND ( BITS ) <> Logical kind selection. <> Transformational function. <> BITS shall be an integer scalar. <> Default integer scalar. <> The result has a value equal to the value of the kind type parameter of logical type that is represented by the least number of bits greater than or equal to BITS, or if no such kind type parameter is available on the processor, the result is -1. <> Assume a processor supports four logical kinds with parameter values 8 for an 8-bit representation, 16 for a 16-bit representation, 32 for a 32-bit representation, and 64 for a 64-bit representation. On this processor, SELECTED_LOGICAL_KIND(1) has the value 8, SELECTED_LOGICAL_KIND(12) has the value 16, and SELECTED_LOGICAL_KIND(128) has the value -1. Note X SELECTED_LOGICAL_KIND(1) returns the logical kind value of the representation with smallest storage size. "