To: J3 J3/18-257
From: Dan Nagle
Subject: log and friends
Date: 2018-October-01
I Introduction
At 215, J3 agreed, and at 216 WG5 concurred, to add the following
to the iso_fortran_env intrinsic module.
log8 - an integer constant whose value is the kind value
of an 8-bit logical
log16 - an integer constant whose value is the kind value
of a 16-bit logical
log32 - an integer constant whose value is the kind value
of a 32-bit logical
log64 - an integer constant whose value is the kind value
of an 64-bit logical
real16 - an integer constant whose value is the kind value
of a 16-bit real
II Use-cases
At times, one wants the smallest, or the fastest, logical.
Presently, there is no way to get these kind values, other
than trying to decode the logical_kinds array. However,
this array is unsorted, and so it is useless for the purpose.
Newer hardware now supports a 16-bit real (for use in AI work).
This is missing from the current real32, real64, real128 set.
III What I have in mind
Add log[8-64] and real16 to iso_fortran_env.
Straw Vote the (presumably negative) value if none is available:
If no real16 is available, real16 ==
1. -6 (the next available negative number) 'no such real that small' ?
2. any other negative number but not (-1, -2, -3, -4, -5)
3. undecided
IV (Rough) Requirements
iso_fortran_env is expanded to include:
log8 - a default integer constant whose value is the kind value
of an 8-bit logical, or -1 if no such kind is available
log16 - a default integer constant whose value is the kind value
of an 16-bit logical, or -1 if no such kind is available
log32 - a default integer constant whose value is the kind value
of an 32-bit logical, or -1 if no such kind is available
log64 - a default integer constant whose value is the kind value
of an 64-bit logical, or -1 if no such kind is available
real16 - a default integer constant whose value is the kind value
of a 16-bit real kind, or a negative (-6?) value if no such
kind is available.